正则表达式\ p {L}和\ p {N} [英] Regular expression \p{L} and \p{N}
本文介绍了正则表达式\ p {L}和\ p {N}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是正则表达式的新手,并已获得以下正则表达式:
I am new to regular expressions and have been given the following regular expression:
(\p{L}|\p{N}|_|-|\.)*
我知道*是什么意思|表示或",并且\转义.
I know what * means and | means "or" and that \ escapes.
但是我不知道\p{L}
和\p{N}
是什么意思.我已经在Google上搜索了此搜索,但没有结果...
But what I don't know what \p{L}
and \p{N}
means. I have searched Google for it, without result...
有人可以帮助我吗?
推荐答案
\p{L}
匹配类别字母"中的单个代码点.
\p{N}
与任何脚本中的任何数字字符匹配.
\p{L}
matches a single code point in the category "letter".
\p{N}
matches any kind of numeric character in any script.
Source: regular-expressions.info
如果您打算大量使用正则表达式,建议您为该站点添加书签,这非常有用.
If you're going to work with regular expressions a lot, I'd suggest bookmarking that site, it's very useful.
这篇关于正则表达式\ p {L}和\ p {N}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文