How do I replace with text:
<img src="anyurl">
with:
<some extra html><img src="anyurl" alt=""></someextrahtml>
What is right regex to handle <img src="*">
?
Try this regex:
/<img\s+src="(.*?)"\s+\/?>/
It'll grap the source of images.
EDIT
Here it is in PHP!
preg_match('/<img\s+src="(.*?)"\s+\/?>/', $target, $matches);
var_dump($matches);
So your src should be in $matches[0];