简体   繁体   English

ng-pattern仅适用于希伯来语字符

[英]ng-pattern for only hebrew characters

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. 我想使用ng-pattern验证我的文本输入字段,该字段应仅接受希伯来字符,有时输入没问题,有时由于某种原因而被拒绝。 (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 = /^[\א-\׳]+$/g; 给出的解决方案是:scope.onlyHebrewPattern = / ^ [\\ u05D0- \\ u05F3] + $ / g;

original post 原始帖子

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM