preg_match & regex fail to catch full url with filename "a.jpg_x.jpg"

Posted by Lee on Stack Overflow See other posts from Stack Overflow or by Lee
Published on 2010-06-03T01:20:10Z Indexed on 2010/06/03 1:24 UTC
Read the original article Hit count: 312

Filed under:
|

Hi, I use in my code :

preg_match( '!http://[^?#]+\.(?:jpe?g|png|gif)!Ui' , $str[1], $results );

It work in most cases except:

src='http://www.domain.com/Pic/folder1/folder2/a.jpg_x.jpg' alt=

I get:

......older2/a.jpg

I need:

.....older2/a.jpg_x.jpg

any ideas?

Thanks in advance

© Stack Overflow or respective owner

Related posts about php

Related posts about regex