我有以下内容:
$Variable = $Row['Title'];
$Variable = $Row['FirstName'];
$Variable = $Row['MiddleName'];
$Variable = $Row['LastName'];
$Variable = $Row['KnownAs'];
$Variable = $Row['FullName'];
但是想要用''之间的名称替换$ Variable,所以上面应该是这样的:
$Title = $Row['Title'];
$FirstName = $Row['FirstName'];
$MiddleName = $Row['MiddleName'];
$LastName = $Row['LastName'];
$KnownAs = $Row['KnownAs'];
$FullName = $Row['FullName'];
我如何在Notepad ++中执行此操作
答案 0 :(得分:3)
查找
\$Variable( = \$Row\['(\w+)'\];)
替换:
$\2\1
说明:
\$
因为美元符号是需要转义的特殊字符。( = \$Row\['(\w+)'\];)
是您想要复制的第一个捕获组。(\w+)
是第二个捕获组,其中\w
是单词字符,+
表示“至少为1”。截图: