I use the following regular expression to get the url of a img-Tag:
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post_single->post_content, $matches);
However, $matches gives me the following results:
http://example.com/wp-content/uploads/2013/11/dsc_842.jpg
-> This is fine.
http://example.com/wp-content/uploads/2013/11/dsc_0546.jpg?w=640
-> This is not fine.
How can I change the regular expression in order to prevent cases where ?w=640
is included in my result?
Help is much appreciated.
Thank you!