java - {L} Unicode 类别是什么?

标签 java regex unicode character-properties

我遇到了一些包含 [^\\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/

相关文章:

java - 读取外部进程错误流严重影响性能

regex - R:gsub 和捕获

c - fseek 和 Microsoft 的 CRT UNICODE 支持存在问题

c++ - 使用 Visual Studio 在控制台中输出 utf8(宽流)

java - Mockito - 深度 stub

java - 将数组保存在 Vector 中并再次取出

Javascript 正则表达式将链接插入列表

python - 编码/解码有什么区别?

java - 在 Java JPA 中返回 map ?

java - 正则表达式 replaceAll 的问题