I am having some trouble with this regex:
<img(.+)src="_image/([0-9]*)/(.+)/>
Global and case insensitive flags is on.
The problem is that it also grabs Image n (see string below), but I want it only to match the image tags in the string.
<p>Image 1:<img width="199" src="_image/12/label" alt=""/> Image 2: <img width="199" src="_image/12/label" alt=""/><img width="199" src="_image/12/label" alt=""/></p>
It works if I put a newline before Image n 🙂
Can anyone point out for me what I am doing wrong?
Thanks in advance
bob
Use a non-greedy regexp:
<img .? src=”_image/(\d+)/(.+?)/.?>