如何为$ 1使用notepad ++的正则表达式

时间:2012-10-31 06:56:14

标签: regex notepad++

  

可能重复:
  Find and Replace in Notepad++ using Regular Expression

如何为$ 1使用记事本++的正则表达式 当我使用php时,我通常会这样写:
preg_replace(“@ aa(。*)bb @”,$ 1,$ str),但是1美元在记事本中不是很好 enter image description here

2 个答案:

答案 0 :(得分:2)

只需使用\1,这也很常见。

@import "\1";

另请参阅:Understanding RegEx with Notepad++

答案 1 :(得分:1)

升级到current Notepad++ version

Version 6.0 Notepad++ is supporting PCRE以来,这是一项很大的改进,您也可以在替换字符串中使用$1

在旧版本中,您必须使用\1来获取第一个捕获组的内容。

相关问题