正则表达式 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}
是什么意思.我在谷歌上搜索过,没有结果......
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屋!
查看全文