I have a lot of URLs like this one
<a href="http://abc123.linkbucks.com"><img src="http://img187.imagevenue.com/loc1115/th_99189_image_122_1115lo.jpg" /></a>
I need to substitute the href part whith the img src part, so it would say
<a href="http://img187.imagevenue.com/loc1115/th_99189_image_122_1115lo.jpg"><img src="http://img187.imagevenue.com/loc1115/th_99189_image_122_1115lo.jpg" /></a>
and then replace the loc???/th_ part with img.php?image= so it would be
<a href="http://img187.imagevenue.com/img.php?image=99189_image_122_1115lo.jpg"><img src="http://img187.imagevenue.com/loc1115/th_99189_image_122_1115lo.jpg" /></a>
Can anyone help me do this with TextWrangler for Mac? The linkbucks links and loc and img bits are all random. I ve tried searching but the solutions seem to be very specific and my understanding of regex is so scarce... Thank you!