如何将正则表达式用于$1的notepad++ [duplicate]

时间:2021-08-12 23:36:18

Possible Duplicate:
Find and Replace in Notepad++ using Regular Expression

可能的重复:使用正则表达式在Notepad++中查找和替换

how to use regular expression for notepad++ for $1
when i use php ,I usually write it like this:
preg_replace("@aa(.*)bb@",$1,$str), but $1 is not wooking in notepad++
如何将正则表达式用于$1的notepad++ [duplicate]

当我使用php时,我通常是这样写的:preg_replace(“@aa(.*)bb@”,$1,$str),但是$1在notepad+中不是这样写的

2 个解决方案

#1


2  

Simply use \1, which is also very common.

简单地使用\1,这也是很常见的。

@import "\1";

See also: Understanding RegEx with Notepad++

参见:使用Notepad++了解RegEx

#2


1  

Upgrade to the current Notepad++ version.

升级到当前的Notepad++版本。

Since Version 6.0 Notepad++ is supporting PCRE, which is a great improvement and there you can also use $1 in the replacement string.

因为Version 6.0 Notepad++是支持PCRE的,这是一个很大的改进,您也可以在替换字符串中使用$1。

In the older versions you have to use \1 to get the content of the first capturing group.

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

#1


2  

Simply use \1, which is also very common.

简单地使用\1,这也是很常见的。

@import "\1";

See also: Understanding RegEx with Notepad++

参见:使用Notepad++了解RegEx

#2


1  

Upgrade to the current Notepad++ version.

升级到当前的Notepad++版本。

Since Version 6.0 Notepad++ is supporting PCRE, which is a great improvement and there you can also use $1 in the replacement string.

因为Version 6.0 Notepad++是支持PCRE的,这是一个很大的改进,您也可以在替换字符串中使用$1。

In the older versions you have to use \1 to get the content of the first capturing group.

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