I'm trying to get the image urls from html source code using the following regex, but it fails when the image url has spaces in it. For example this url:
<img src="http://a57.foxnews.com/global.fncstatic.com/static/managed/img/Entertainment/876/493/kazantsev pink bikini reuters.jpg?ve=1&tl=1" alt="kazantsev pink bikini reuters.jpg" itemprop="image">
$image_regex_src_url = '/<img[^>]*'.'src=[\"|\'](.*)[\"|\']/Ui';
preg_match_all($image_regex_src_url, $string, $out, PREG_PATTERN_ORDER);
This gives me back the following.
http://a57.foxnews.com/global.fncstatic.com/static/managed/img/Entertainment/876/493/kazantsev
Is there a way to match any character including whitespace? Or is it something I have to set in the php configuration?