I have a lot of php files that must be changed, and I decided to use Sublime for it. Now I want to change lines like
<td width="17%" class="listhdrr"><?=gettext("SOME TEXT");?></td>
to
<th><?=gettext("SOME TEXT");?></th>
I used
<td width="\d+%" class="listhdrr"><\?=gettext\("[A-Za-z\s+]+"\);\?></td>
regular expression. I don't need width of table's column but I want SOME TEXT in example.
My Replace expression was
<th><?=gettext("$1");?></th> OR <th><?=gettext("\1");?></th>
that doesn't work for replace SOME TEXT Part.
Try the following;
<td width="\d+%" class="listhdrr"><\?=gettext\("(.+)"\);\?><\/td>
And use this for the substitution;
<th><?=gettext("$1");?></th>
To make use of the $1 in the match you need the brackets around the area you want to catch;
gettext("(.+)")
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments