我正在使用Komodo,需要查找/替换大量代码。
我需要替换以下所有出现的内容,但保留其中的某一部分,如下所示:
<th title="THIS IS THE STRING THAT NEEDS TO BE RETAINED">StartDate</th>
替换为::
<th><?=$this->Html->image('bm.acp.help.png', array('alt' => 'Help', 'title'=>'THIS IS THE STRING THAT NEEDS TO BE RETAINED'));?>StartDate</th>
任何人都可以帮助我吗?
由于 凯文
答案 0 :(得分:0)
perl -e '
$a = qq{<th title="THIS IS THE STRING THAT NEEDS TO BE RETAINED">StartDate</th>};
$a =~ s{<th title=\"(.*)\">(.*)<\/th>}{<th><?=$this->Html->image("bm.acp.help.png", array("alt" => "Help", "title"=>"$1"));?>$2<\\th>};
print "\n\n$a";'