Page 1 of 1

Replace a variable string

Posted: Wed Nov 30, 2005 4:59 am
by ade30abacre
OK - I tried looking thru the posts - so sorry if I missed the answer...


I need a way to replace abcde12345 with abcde12345.html in many lines of code within many files. (12345 can be any number generated by PHP)

I cannot find the \e switch in options...

I cannot find "insert after" in 'batch replace'

So - looking for way to use regexp in replace string.....

Posted: Wed Nov 30, 2005 8:37 am
by Abacre
Hi,

Go to main menu - Action - Options - Batch Replace,
check "Modifier G"

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
abcde(\d+)

Replace with:
abcde$1.html

Explanations:
\d means any digit
\d+ more than one digit
() means we take this part and put into into $1 which we use in
"replace with" part.

That's all I verified it works perfectly.