Adleron Adleron - 1 year ago 143
AngularJS Question

ng-pattern for only hebrew characters

I want to use

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.)

<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

Answer Source
$scope.onlyHebrewPattern = /^[א-ת\s]+$/;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download