Page 1 of 1

Regular Expression Need Help On

Posted: Thu Nov 30, 2006 8:01 pm
by mickster
Hi i need to remove the -3**** number after my words but before the .html

<a href="North-East-30404.html">North East</a>
<a href="North-West-30426.html">North West</a>
<a href="South-East-30448.html">South East</a>

so I end up with the following

<a href="North-East.html">North East</a>
<a href="North-West.html">North West</a>
<a href="South-East.html">South East</a>

I have to many to do by hand. What regular expression could i use to do this? any suggestions?

Thanks

Posted: Thu Nov 30, 2006 11:07 pm
by Abacre
For your particular task you may use the following:

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

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
<a href="(\w+)-(\w+)-3\d+\.html">\1 \2</a>

Replace with:
<a href="$1-$2.html">$1 $2</a>

That's all I verified it works perfectly.