I have the following regex expression.
/<img.+src=['"](?P<src>.+?)['"].*>/i
However When I run this on any string that has more than one image in it, it is returning the last image. In fact it is returning the last src occurance regardless if it is an image or not.
And this is because it is selecting from <img
to the last next linebreak and not stopping at the end >
of the tag.
How can I change my regex to stop at the >
of the <img>
tag
Take a look at this example