1) How to use regular expressions in Angularjs
<input type= "text" ng-model= "Dutycode" ng-focus= "showdutycodetips = True"
Ng-blur= "showdutycodetips = False" ng-pattern= "/^cv[0-9a-z]{5}$/" >
<span ng-init= "showdutycodetips = False" ng-show= "Showdutycodetips"
Style= "color:red" > Responsibility Coding Rules are: cv+5 bit (numeric or uppercase letters) </span>
2) How to use regular expressions in JS
.) Use RegExp to dynamically set regular expressions
if (! New RegExp ("PL" + Param.productclass + "[0-9a-z]{5}"). Test (Param.plancode)) {
Uitips.alert ("Insurance Code rules: pl+2-bit Products Large class code + 5 digits (number or capital letters)");
Return
}
.) The direct use of regular expressions (expressions cannot be pieced together)
var reg =/^pl03[0-9a-z]{5}$/;
Console.log (Reg.test ("pl03aaaaa"));
3) Use regular expressions in Java code
String postfix = "ABCDE"
return Pattern.compile ("[0-9a-z]{5}"). Matcher (Postfix). matches ();
The use of regular expressions in JS and Java