匹配img标签 src中的链接(带png,jpg等后缀) :
preg_match('/<img.+src=\"?(.+\.(jpg|gif|bmp|bnp|png))\"?.+>/i', stripcslashes($str), $match);
匹配img标签 src中的链接(图库数据,不带后缀) :
preg_match('/<img.+src=\"?([^\"]+)\"?.+>/i', stripcslashes($str), $match);
匹配文本中的域名 :
preg_match('/(http|https){1}(:\/\/)?([\da-z-\.]+)\.([a-z]{2,6})([\/\w \.-?&%-=]*)*\/?/', stripcslashes($str), $match);