2014-07-11 2 views
0

나는 코모도를 사용하고 있으며 엄청난 양의 코드를 찾아서 교체해야합니다.정규식 help - string 찾기 및 바꾸기

다음과 같이 나는 다음의 모든 항목을 대체하지만, 그것의 일정 부분을 유지하기 위해 필요

:

<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
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";'