I am trying to modify an epub file that uses image files instead of accented letters. I am replacing the images with unicode characters. In order to do this I need to perform a find and replace on a regex matching the image tag, from the opening angle bracket to the closing one. However, consider the following:
Code: Select all
<img alt="image" src="c0011-01.jpg"/>s</strong> because the <strong>mi</strong> is short, but <strong>a-m<img alt="image" src="c0007-01.jpg"/>-tus</strong> because the <strong>m<img alt="image" src="c0025-01.jpg"/>
I want to target the image tag containing c0007-01.jpg but it is flanked by two other image tags. Any regex I have tried targets from the first image tag (c0011-01.jpg) to the third c0025.jpg). I need a regex that:
- starts at the "<" and ends at the ">" (so I can execute a find and replace cleanly)
must contain c0007-01.jpg
does not contain any additional "<" within
If I have a regex that fulfills the above criteria, I'm fairly sure that it will only target the tag I want. Any help would be greatly appreciated.