The problem
I need to go through each html page in a folder/sub folder and alter
the src attribute to a flat directory structure and prefixed with an
absolute path
To do this I was going to write a simple app but decided instead to try
and use the find and replace in files options in VS 2003.
My issue is that my regex really sucks.
What I need to do is take
<img src="./a/test/img.jpg">
<img src='a/test/img.gif'>
<img src='a/deep/test/img.jpg'>
type url's and replace with
<img src="http://myserver/images/img.jpg">
<img src="http://myserver/images/img.gif">
etc
Any ideas how I could do this?
Mike Blake-Knox - 25 Aug 2006 18:25 GMT
> What I need to do is take
> <img src="./a/test/img.jpg">
[quoted text clipped - 4 lines]
> <img src="http://myserver/images/img.gif">
> etc
Try something like <img src="./a/test/{[a-zA-Z0-9]+}\.{(jpg)|(gif)}" in
Find what and <img src="http://myserver/images/\1.\2" in the Replace
with field of the VS Replace dialog.
You could use ["'] instead of " in the Find text if you really have a
mixture of single and double quotes.
Mike