View Full Version : search and replace regular expressions

02-02-2006, 04:11 PM

I am having to convert a large .asp site (1000 pages) to .htm and have all the links in this format

definition (../../default.asp?option=503) etc etc

I have been trying to find a way of searching and replacing all the links <a href="../../default.asp?option=503" to href="../../503.htm"

I know I need to use the regular expressions in the advanced search and replace but have not been unable to work out how.

I have some links that are <a href="...option=3">and href="...option=05"> in other words =x or =xx.

I need to be able to search for the single and multible digit numbers without catching the <h1> to <h6> and replacing any number after the = with .htm

simply put ... turning this format

definition (../../default.asp?option=503)

into this

definition (../../=503.htm)

Any help urgently needed and gratfully recieved


Creative Insanity
02-02-2006, 05:08 PM
Real simple solution to this.
View the site as an asp site in a web browser and then just view source and then copy the source and paste it into dw and save as the same page name, but as .htm rather than .asp.

That is what I do if I cannot convince the person to keep the dynamic site as static is so out of date now days.

02-02-2006, 05:27 PM
me neither... If all you're looking for is having .html extensions and remove the dynamic url's because of searchengines, there's easaier ways of doing this.

02-03-2006, 04:48 AM
Thanks for the ideas but unfortunately these links permiate all pages. If a page links to another page it calls the links from a list in the default.asp.

So I need to alter all the links in all the pages :-(

If there is an easier way I would love to hear of it please.

Thanks for the input so far.