在网上复制文章的时候经常文章中夹杂如下内容
(xxx网 www.xxx.com)
(xxx网 xxx.com)
(xxx网 www.xxx.cn)
(xxx网 www.xxx.net)
【xxx网 www.xxx.com.cn】
[xxx网 www.xxx.cn]
(xxx网 xxx.com)
规则是网站信息用中文()或者【】或者〖〗『』「」或者英文()[]括起来
里面的内容多为网址
跪求一条可以删除这些的正则
$s=<<<txtwww.aa.com(xxx网 www.xxx.com)www.xxbbx.com(xxx网 xxx.com)(xxx网 www.xxx.cn)(xxx网 www.xxx.net)ss【xxx网 www.xxx.com.cn】[xxx网 www.xxx.cn](xxx网 xxx.com)txt;$p=array( "/(.+?)/", "/【.+?】/", "/〖.+?〗/", "/『.+?』/", "/「.+?」/", "/\[.+?\]/", "/\(.+?\)/");echo preg_replace($p,'',$s);
楼上v5,可敬
$s=<<<txtwww.aa.com(xxx网 www.xxx.com)www.xxbbx.com(xxx网 xxx.com)(xxx网 www.xxx.cn)(xxx网 www.xxx.net)ss【xxx网 www.xxx.com.cn】[xxx网 www.xxx.cn](xxx网 xxx.com)txt;$p=array( "/(.+?)/", "/【.+?】/", "/〖.+?〗/", "/『.+?』/", "/「.+?」/", "/\[.+?\]/", "/\(.+?\)/");echo preg_replace($p,'',$s);
$s=<<<txtwww.aa.com(xxx网 www.xxx.com)www.xxbbx.com(xxx网 xxx.com)(xxx网 www.xxx.cn)(xxx网 www.xxx.net)ss【xxx网 www.xxx.com.cn】[xxx网 www.xxx.cn](xxx网 xxx.com)txt;$p=array( "/(.+?)/", "/【.+?】/", "/〖.+?〗/", "/『.+?』/", "/「.+?」/", "/\[.+?\]/", "/\(.+?\)/");echo preg_replace($p,'',$s);
$s=<<<txtwww.aa.com(xxx网 www.xxx.com)www.xxbbx.com(xxx网 xxx.com)(xxx网 www.xxx.cn)(xxx网 www.xxx.net)ss【xxx网 www.xxx.com.cn】[xxx网 www.xxx.cn](xxx网 xxx.com)txt;$p=array( "/(.+?)/", "/【.+?】/", "/〖.+?〗/", "/『.+?』/", "/「.+?」/", "/\[.+?\]/", "/\(.+?\)/");echo preg_replace($p,'',$s);
$s=<<<txtwww.aa.com(xxx网 www.xxx.com)www.xxbbx.com(xxx网 xxx.com)(xxx网 www.xxx.cn)(xxx网 www.xxx.net)ss【xxx网 www.xxx.com.cn】[xxx网 www.xxx.cn](xxx网 xxx.com)txt;$p=array( "/(.+?)/", "/【.+?】/", "/〖.+?〗/", "/『.+?』/", "/「.+?」/", "/\[.+?\]/", "/\(.+?\)/");echo preg_replace($p,'',$s);
$p=array( "/(.+?(com|cn|net))/", "/【.+?(com|cn|net)】/", "/〖.+?(com|cn|net)〗/", "/『.+?(com|cn|net)』/", "/「.+?(com|cn|net)」/", "/\[.+?(com|cn|net)\]/", "/\(.+?(com|cn|net)\)/");
再改一下,这样好点:
$p=array( "/(.+?\.(com|cn|net))/", "/【.+?\.(com|cn|net)】/", "/〖.+?\.(com|cn|net)〗/", "/『.+?\.(com|cn|net)』/", "/「.+?\.(com|cn|net)」/", "/\[.+?\.(com|cn|net)\]/", "/\(.+?\.(com|cn|net)\)/");
再改一下,这样好点:
$p=array( "/(.+?\.(com|cn|net))/", "/【.+?\.(com|cn|net)】/", "/〖.+?\.(com|cn|net)〗/", "/『.+?\.(com|cn|net)』/", "/「.+?\.(com|cn|net)」/", "/\[.+?\.(com|cn|net)\]/", "/\(.+?\.(com|cn|net)\)/");
再改一下,这样好点:
$p=array( "/(.+?\.(com|cn|net))/", "/【.+?\.(com|cn|net)】/", "/〖.+?\.(com|cn|net)〗/", "/『.+?\.(com|cn|net)』/", "/「.+?\.(com|cn|net)」/", "/\[.+?\.(com|cn|net)\]/", "/\(.+?\.(com|cn|net)\)/");