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

2024-02-03

我想用ng-pattern验证我的文本输入字段应该只接受希伯来语字符,有时输入没问题,有时由于某种原因被拒绝。 (第一个字母是验证,第二个字母不是,等等) 例子:

<input type="text" class="form-control" name="firstName" ng-model="Join.firstName" id="firstName" aria-describedby="firstNameHelp" maxlength="15" ng-pattern="onlyHebrewPattern" required>

给出的解决方案是: scope.onlyHebrewPattern = /^[\u05D0-\u05F3]+$/g;

原帖 https://stackoverflow.com/questions/19392528/undesirable-result-of-use-of-ng-pattern-angular-js-with-unicode-characters


$scope.onlyHebrewPattern = /^[א-ת\s]+$/;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

仅适用于希伯来语字符的 ng-pattern 的相关文章

随机推荐