瑞典人用javascript检查? [英] swedish characters check with javascript?
本文介绍了瑞典人用javascript检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何重写此代码以检查所有字符,包括瑞典语å,ä和ö字符?
alphaExp = / ^ [a-zA-Z] + $ /;
以上只针对英文字母进行检查!
<瑞典包含å,ä,ö在Z之后出现...休息与英语完全相同。
谢谢
解决方案
非常直接从马的嘴里出来:
在JavaScript的RegExp支持
国际化几乎不存在。
查看链接后的帖子,了解如何解决此问题(通过定义自己的角色类)。
How can I rewrite this code to check for all characters including the swedish å, ä, and ö characters?
alphaExp = /^[a-zA-Z]+$/;
The above only checks against english letters!
The swedish contains å, ä, ö coming after the Z... rest is all the same as english.
Thanks
解决方案
Pretty much straight from the horse's mouth:
Support for internationalization in JavaScript's RegExp is virtually nonexistent.
See the posts following the linked one for how to get around this (by defining your own character class).
这篇关于瑞典人用javascript检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文