如何搜索字符串的一部分而不是完整的字符串记事本++

时间:2014-11-19 09:01:57

标签: regex notepad++

使用Notepad ++我想在文件中搜索C:\ test但是排除C:\ testing - 我相信这可以在正则表达式中完成,但不知道从哪里开始。

1 个答案:

答案 0 :(得分:1)

\bC:\\test\b

试试这个。这应该为你做。

\b是单词边界。

`有三种不同的职位符合词边界:

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.`