下面二款php教程 正则来表达式来处理url匹配的代码,希望对你有点帮助。
<?php
$url = 'http://www.bai***du.com/zongzi/oo.html';
$n = preg_match_all("/http:[/]{2}[a-z]+[.]{1}[a-zd-]+[.]{1}[a-zd]*[/]*[A-Za-zd]*[/]*[A-Za-zd]*[.]*html/",$url,$array);
var_dump($array);
?>
例子
$url = 'http://www.te***st.com/icons/favicon-54.ico, http://www.b***aidu.com/bb, http://www.1**1*1com.net, http://img.*b*aid*u.com/logo.ico';
$pattern = "|http://[^,*]+?.*ico*,?|U";
preg_match_all($pattern, $url, $matches);
print_r($matches);
输出结果:
Array
(
[0] => Array
(
[0] => http://www.*te**st.com/icons/favicon-54.ico
[1] => http://img.ba*i**du.com/logo.ico
))
韩剧再婚皇后阿里云盘全集高清1080P资源链接-韩剧再婚皇后免费阿里云盘资源下载4K高清无删减版链接
poipiku网站如何打开-poipiku官网网页版访问入口
明日方舟:终末地-云游戏畅玩入口-明日方舟:终末地-网页版在线直连地址
poki在线小游戏网页版-poki免费游戏大全入口
poki游戏入口-点开即玩-poki游戏-在线免费畅玩
原神akt大佬资源viciNeko入口链接-原神akt大佬资源网页vicineko入口链接分享