Replace a variable string

General discussions about Advanced Find and Replace
Post Reply
ade30abacre
Posts: 1
Joined: Tue Nov 29, 2005 10:27 pm

Replace a variable string

Post 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.....

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post 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.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply