为什么Notepad++中的[[:alpha:]]也匹配中文?

Why does [[:alpha:]] in Notepad++ also match Chinese words?

为什么正则表达式[[:alpha:]]在Notepad++中也能匹配中文单词?例如,中文

根据Notepad++的文档

alpha : ASCII letters

中文单词不是ASCII字母,为什么正则表达式能匹配到?

[:alpha:] class 通常匹配字母字符。这将远远超过 ASCII 字母,具体取决于您使用的编码。

Notepad++ documentation does state "ASCII letters", it also indicates that regexes are implemented using the Boost C++ Regex library. Documentation confirms that [:alpha:] has the standard, broader meaning in this library.

这似乎只是 Notepad++ 文档中的一个错误。

如果您需要匹配 ASCII 字母,我会使用类似 [a-zA-Z] 的内容作为起点。