What does regex pattern “[\P{L}]+” mean in Java?
本问题已经有最佳答案,请猛点这里访问。
代码:
输出:
1 2 3 | AAAA DDDD DDDD |
请注意,它是
您可以在
Unicode scripts, blocks, categories and binary properties are written with the
\p and\P constructs as in Perl.\p{prop} matches if the input has the property prop, while\P{prop} does not match if the input has that property.
所以它与
简单:与
基本上都是"非字母"。
我在API中找不到确切的引用,但是你可以从行为中推断出这个建议,或者说,从
编辑(归功于图纳基的眼睛)
这实际上是由文档中的以下语句建议的:
Unicode blocks and categories are written with the \p and \P
constructs as in Perl.