我遇到了一些包含 [^\\p{L}]
的正则表达式。我知道这是使用某种形式的 Unicode 类别,但是当我检查 the documentation 时,我只找到了以下“L”类别:
Lu Uppercase letter UPPERCASE_LETTER
Ll Lowercase letter LOWERCASE_LETTER
Lt Titlecase letter TITLECASE_LETTER
Lm Modifier letter MODIFIER_LETTER
Lo Other letter OTHER_LETTER
在此上下文中,L
是什么?
最佳答案
取自此链接:http://www.regular-expressions.info/unicode.html
检查 Unicode 字符属性
部分。
\p{L} matches a single code point in the category "letter". If your input string is à encoded as U+0061 U+0300, it matches a without the accent. If the input is à encoded as U+00E0, it matches à with the accent. The reason is that both the code points U+0061 (a) and U+00E0 (à) are in the category "letter", while U+0300 is in the category "mark".
关于java - {L} Unicode 类别是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5969440/