I'm trying to do a conditional regsub of some html pages. I want to
prefix all local file references with a directory path and ignore all
external references (ie http://). For instance, I want change:
<img src="test.jpg" border="0">
to:
<img src="/some_directory/test.jpg" border="0">
Here is the regsub code I came up with:
regsub -all -nocase {(<img.+?src=).*?([^/" ]+)[" ]*(.*>)} $body "
"$new_path/" " body
However, I want to exclude it from modifying:
<img src="http://www.somerandomdomain.com/test.jpg" border="0">
Again, I want to modify all local references to images and leave all
external references alone. Any ideas?