Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
wordA - 不能被捕获
单词 - 必须被捕获
这行不通....
\w+[^A]\b
为什么?
[^A]将匹配空间:
[^A]
hello world ^^^^^^
尝试look-behind:
look-behind
\w+(?<=[^A])\b
如果您正在处理英语单词,请尝试以下操作:
\w+[a-zB-Z_]\b
尝试消极的回顾:
\w+\b(?<!A)
实际上,我发现了第三种方式,这在我的情况下似乎可行:
\w+[^A\s]\b