I have following code (php), it will match img-src and replace with new url
$rep = array('/', '+', '(', ')');
$with = array('\/', '\+', '\(', '\)');
$match_pattern = '/<img[^<]*src\s*=\s*\"'.str_replace($rep, $with, $source_url).'\"[^>]*>/iUu';
$img_replace_str = '<img src="'.$new_url.'" />';
$post_content = preg_replace($match_pattern, $img_replace_str, $post_content);
For images that have src as "http://www.example.com/a.jpg", there is no issue, but for images that have src that contains query string like "http://www.example.com/b.jpg?height=900", it's not matching
I want to match images with and without query string.