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

ng-pattern for only hebrew characters

我想使用 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;

original post

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