How to parse bunch of files and replace each occurance of __esct function?
__esct('Full name')
convert to:
$this->escape($this->translate('Full name'))
I'm confused as to - how to add that second brace after replaced text?
|
How to parse bunch of files and replace each occurance of __esct function?
convert to:
I'm confused as to - how to add that second brace after replaced text? |
|||
|
|
|
Try using this :
|
|||||||||||
|
|
Perl has nice extensions to do something like that:
It will leave the originals as <file>.bak. This is just a global replace on each line, just as you'd write it in vi(1). In Perl, () and such are metacharacters, to match them you need \( \). [I'm not 100% sure of the handling of the ', need to check what your particular shell does in such a case.] |
||||
|
|
Should get you a long way. It'll fail if you have
This one will work for those, but fail for |
|||||||||
|