由网友(Déprimé(郁闷))分享简介:我需要验证文本输入,这样用户就可以插入字符/文本,其中可能包括德国的变音,法语口音以及任何其他有效的欧洲字符,例如微不足道的直径。I need to validate a text input so a user can insert characters/text that may include German u...
我需要验证文本输入,这样用户就可以插入字符/文本,其中可能包括德国的变音,法语口音以及任何其他有效的欧洲字符,例如微不足道的直径。
I need to validate a text input so a user can insert characters/text that may include German umlauts, French accents and any other valid European characters, for example the minuscule ø.
我使用AngularJS,所以我将我的验证规则给 NG-模式
属性,像这样:
I am using AngularJS so I am applying my validation rule to the ng-pattern
attribute like so:
ng-pattern="/^[A-Za-z0-9 -_.]*$/"
我希望这将覆盖像äöüß字符,但在测试时它没有。对不起,问这样一个蹩脚的问题,但我真的不擅长的正则表达式!必须有一个更好的方式比手动列出像这样 NG-图案字母=/ ^ [A-ZA-z0-9äöüÄÖÜ -_] * $ /
推荐答案
[A-ZA-Z x7f- XFF]
中含有大量的特殊字符,如邻üéß我......
[a-zA-Zx7f-xff]
contains a lot of special characters such as ä ö ü é ß î...
相关推荐
最新文章