I'm a noob so any pointers you guys could give would be great.
I'm trying to use a RegEx program to edit XML, replacing certain images with their own alt text. Here's what I got.
<graphic.*-A.[a-zA-Z]{3}" alt="(.*)".*>
This finds any image that has "-A." in the filename, any extension type. And it collects the alt text as a capture group. So far so good.
Where I'm running into trouble is that sometimes the images DON'T have alt text. In these cases what's happening is that the program keeps looking, multiple lines if necessary, until it finds an alt text tag. This results in large portions of my XML being destroyed. How can I get it to leave the graphic tags alone if there isn't any alt text in there? Thanks.