angularjs-ng-pattern

How to add password validation using regular expression in angularjs according to certain criterion?

霸气de小男生 提交于 2020-01-12 14:27:07
问题 I want to validate password entered by user for following criteria : Password should be at least 8 characters long and should contain one number,one character and one special character. For it I used following regular expression : ^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$ I tried this expression in my angularjs code as below : <md-input-container class="md-block" style="margin-top:0px;"> <label>Password</label> <md-icon md-svg-src="/images/icons/ic_lock_black_24px.svg"

How to add password validation using regular expression in angularjs according to certain criterion?

ぐ巨炮叔叔 提交于 2020-01-12 14:26:04
问题 I want to validate password entered by user for following criteria : Password should be at least 8 characters long and should contain one number,one character and one special character. For it I used following regular expression : ^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$ I tried this expression in my angularjs code as below : <md-input-container class="md-block" style="margin-top:0px;"> <label>Password</label> <md-icon md-svg-src="/images/icons/ic_lock_black_24px.svg"

Regular expression : match either of two conditions?

心已入冬 提交于 2019-12-12 17:19:45
问题 Hi I don't know much about regular expression. But I need it in form validation using angularJs. Below is the requirement The input box should accept only if either (1) first 2 letters alpha + 6 numeric or (2) 8 numeric Below are some correct Inputs :- (1)SH123456 (2)12345678 (3)sd456565 I tried data-ng-pattern="/(^([a-zA-Z]){2}([0-9]){6})|([0-9]*)?$/" , Its working fine for both the above condition but still it is accepting strings like S2D3E4F5 and may be many other combination as well.

ng-pattern for only hebrew characters

笑着哭i 提交于 2019-12-11 02:10:49
问题 I want to use ng-pattern validate my text input field that should accept only Hebrew characters, sometimes the input are ok and sometimes they are being rejected for some reason. (the first one is validate the second letter is not and etc.) example: <input type="text" class="form-control" name="firstName" ng-model="Join.firstName" id="firstName" aria-describedby="firstNameHelp" maxlength="15" ng-pattern="onlyHebrewPattern" required> and the solution that given was: scope.onlyHebrewPattern = /

ng-pattern with regex having double quotes does not escape correctly

☆樱花仙子☆ 提交于 2019-12-01 18:03:56
问题 I have a ng-pattern validation for a regex of ^[^\./:*\?\"<>\|]{1}[^\/:*\?\"<>\|]{0,254}$ which basically tests the invalid chars in filepath and teh limit. but when i have the ng-pattern specified as ng-pattern = "^[^\\\./:\*\?\"<>\|]{1}[^\\/:\*\?\"<>\|]{0,254}$" , the ng-pattern shows the regex in an incorrect way. any help on achieving this correctly 回答1: First of all, your regex contains too many escaping symbols, while you only need to escape the " here and \\ . Then, to match a " inside