ng-pattern仅适用于希伯来语字符 [英] ng-pattern for only hebrew characters

查看:125
本文介绍了ng-pattern仅适用于希伯来语字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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>

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

and the solution that given was: scope.onlyHebrewPattern = /^[\u05D0-\u05F3]+$/g;

原始帖子

推荐答案

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

这篇关于ng-pattern仅适用于希伯来语字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆