How can I tranform this regex to search only in src=* and not all the links that start with http and end with jpg, png, gif? Additionally I want to get the https images.
Thank you!
preg_match('!http://.+\.(?:jpe?g|png|gif)!Ui' , $content , $matches);
Prefix your regex with a negative assertion to filter out the common occurences:
“Prefixing” means after your
!and before thehttps?://..