Aug 11 2008
Finding
tag through regex
I am saving this for my reference , A post with all commonly used regex, first one to go is finding <img> tag through php using regex.
$pattern = ‘/<img[^>]+src[\\s=\'"]‘;
$pattern .= ‘+([^"\'>\\s]+)/is’;
if(preg_match($pattern,$subject,$match))
{
echo $match[0];
}
[...] >> regex C# Regex MatchCollection Meets Linq First saved by enlightened007 | 3 days ago Finding tag through regex First saved by NewestNuma | 3 days ago regular expressions (aka regEx) tutorial #1 First saved [...]
hi,
the code did not close the img tags properly
example: