加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl循环匹配,并且模式中不包含某字符串

发布时间:2020-12-16 00:13:23 所属栏目:大数据 来源:网络整理
导读:#header-search .search-submit { float: left; width: 80px; height: 30px; margin: 0; padding: 0; border: 0; background: url(../img/header-submit.png) no-repeat; cursor: pointer;} #footer { width: 100%; padding-top: 20px; background: #fff url
#header-search .search-submit { float: left; width: 80px; height: 30px; margin: 0; padding: 0; border: 0; background: url(../img/header-submit.png) no-repeat; cursor: pointer;} #footer { width: 100%; padding-top: 20px; background: #fff url('../img/footer-spl.gif') repeat-x center top;}

单行有多个url,perl进行循环模式匹配,并且不包含“url(”字符串?? ((?!url).)*

while(my $line = <CSS> ) {
        while($line =~ m/url(["|']?(((?!url().)*.(?:png|gif|jpg|jpeg|map))["|']?)/gi) {
                print $1,"n";
        }
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读