ng-pattern for only hebrew characters

2019-07-19 11:29发布

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 = /^[\u05D0-\u05F3]+$/g;

original post

1条回答
霸刀☆藐视天下
2楼-- · 2019-07-19 12:15
$scope.onlyHebrewPattern = /^[א-ת\s]+$/;
查看更多
登录 后发表回答