匹配外来字符的正则表达式是什么? [英] What would be regex for matching foreign characters?

查看:42
本文介绍了匹配外来字符的正则表达式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理欧洲客户的开发和应用程序,他们有自己的本地字符集.

现在我需要使用正则表达式来允许像 eéèêë 等外来字符,但我不确定如何做到这一点.

有什么建议吗?

解决方案

如果你只想匹配字母(包括国际"字母),你可以使用 \p{L}.

您可以在此处找到一些有关正则表达式和 Unicode 的信息.

I am dealing with developing and Application for European Client and they have their native character set.

Now I need to have regex which would allow foreign characters like eéèêë etc and am not sure of how this can be done.

Any Suggestions ?

解决方案

If all you want to match is letters (including "international" letters) you can use \p{L}.

You can find some information on regex and Unicode here.

这篇关于匹配外来字符的正则表达式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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