preg_match_all image source

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-11T15:52:23Z Indexed on 2010/03/11 17:19 UTC
Read the original article Hit count: 240

Filed under:
|
|
|
|

I have the following regex expression which is to extract the source of any img tag in HTML.

/(<img).*(src\s*=\s*"([a-zA-Z0-9\.;:\/\?&=\-_|\r|\n]{1,})")/isxmU

However, it doesn't appear to be matching the following:

<IMG SRC='http://www.mysite.com/pix/lens/mtf/CAEF8512L.gif'>

How can I build it to match this as well?

© Stack Overflow or respective owner

Related posts about regex

Related posts about preg-match