How do you use Notepad++ regex pipe | for strings longer than one character?

后端 未结 5 2313
不知归路
不知归路 2020-12-18 18:54

I\'m trying to get notepad++ to regex find all instances of \"abc\" and \"def\" in the following sentence:

The abc went to the def.

5条回答
  •  情深已故
    2020-12-18 19:54

    Inside a character set declaration ([…]) only the characters \, ] and - are special characters with the special functions of escaping the next character, closing the character set declaration and marking a character range (only if not written at the begin or end), respectively. Any other character is interpretet as a plain character.

    So is your | in [a|d] which means that [a|d] describes any of the characters a, | or d and not just a or d like a|d does.

提交回复
热议问题