The metacharacter \b is an anchor like the caret and the dollar sign.
It matches at a position that is called a "word boundary". This match
is zero-length.
There are three different positions that qualify as word boundaries:
Before the first character in the string, if the first character is a
word character.
After the last character in the string, if the last
character is a word character.
Between two characters in the string,
where one is a word character and the other is not a word character.
最后一个单词边界
\b
是导致正则表达式匹配失败的原因。将图案修改为:会有用的。你知道吗
从docs:
密切注意第二个要点。你知道吗
相关问题 更多 >
编程相关推荐