Hi there,
I have this regex command that is currently finding a list of images in a string but the issue is it's not designed to scan for cases where no quotes are available. Take for example:
<img src=http://www.sitepointforums.com/images/main.gif>
Believe it or not some people are crazy enough to work that into their code. So this is what I currently have:
preg_match_all("/src=[\"']([^\"']+)/", $fixedText, $sub, PREG_SET_ORDER);
The trouble is how do I count for a quote less tags. I've tried a few variations but quite honestly I'm still learning regex. Feel like I'm crawling actually spite the material I'm reading.
I'm thinking somehow I need to check for the quotes if they are there, but disregard them if necessary. The other thing is I'm afraid to change it as this line is really important to a piece of software.
If I change it I'll need to be 100% positive it's right.
*gets on knees and begs* haha.







Bookmarks