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

original post


回答1:


$scope.onlyHebrewPattern = /^[א-ת\s]+$/;


来源:https://stackoverflow.com/questions/39649726/ng-pattern-for-only-hebrew-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!