2018-9-23 乱云飞 评论(0) 浏览(883) 标签: 正则表达式 匹配网址
$str = 'ftp://xfgdf.cctfdghfdghgfdhrtfdthg'; $isMatched = preg_match('/^^((https|http|ftp|rtsp|rtmp|mms)?:\/\/)[^\s]+$/', $str, $matches); echo $matches[0];