[英]Regex match exact word
I have two inputs for registration part of my project: 我在项目的注册部分有两个输入:
<input type="password" ng-model="userData.password">
<input type="password" ng-model="userData.password">
<input type="password" ng-model="userData.confirmPassword">
<input type="password" ng-model="userData.confirmPassword">
I am using ng-pattern to check if userData.confirmPassword is exactly same as userData.password using this: 我正在使用ng-pattern使用以下命令检查userData.confirmPassword是否与userData.password完全相同:
<input ng-pattern="^userData.password$" ng-model="userData.confirmPassword">
The problem with the current code is that: 当前代码的问题是:
What regex can I place to match only if the whole text is matching? 仅当整个文本匹配时,我才能放置哪些正则表达式进行匹配?
根据文档,建议进行以下更改:
<input ng-pattern="{{userData.password}}" ng-model="userData.confirmPassword">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.