PHP URL 正则 图片 url
我现在要匹配一个url地址,如:回复讨论(解决方案)
/((http|https):\/\/)+(\w+\.)+(\w+)[\w\/\.\-]*(jpg|gif|png)/
src后面没有““”双引号单引号
没有alt
没有title
都没有
EOF;$reg = '/
]*src=[\'"]?([^\'"\s]+)[\'"]?[^>]*>/im';$matches = array();preg_match_all($reg, $str, $matches);print_r($matches);
src后面没有““”双引号单引号
没有alt
没有title
都没有
EOF;$reg = '/
]*src=[\'"]?([^\'"\s]+)[\'"]?[^>]*>/im';$matches = array();preg_match_all($reg, $str, $matches);print_r($matches);
好像不能匹配
src后面没有““”双引号单引号
没有alt
没有title
都没有
EOF;$reg = '/
]*src=[\'"]?([^\'"\s]+)[\'"]?[^>]*>/im';$matches = array();preg_match_all($reg, $str, $matches);print_r($matches);
好像不能匹配
举例子的话最好举一个符合html规范的例子,你说的那个例子无意义。
多谢各位!!!
单引号









