源文本:
@Font-face { Font-family: 'Open Sans'; Font-style: normal; Font-weight: 300; src: local('Open Sans light'),local('OpenSans-light'),url(http://themes.Googleusercontent.com/static/Fonts/opensans/v6/DXI1ORHcpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');} @Font-face { Font-family: 'Open Sans'; Font-style: normal; Font-weight: 400; src: local('Open Sans'),local('OpenSans'),url(http://themes.Googleusercontent.com/static/Fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwclxiixG1c.ttf) format('truetype');} @Font-face { Font-family: 'Open Sans'; Font-style: normal; Font-weight: 600; src: local('Open Sans Semibold'),local('OpenSans-Semibold'),url(http://themes.Googleusercontent.com/static/Fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNSonF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');} @Font-face { Font-family: 'Open Sans'; Font-style: normal; Font-weight: 700; src: local('Open Sans Bold'),local('OpenSans-Bold'),url(http://themes.Googleusercontent.com/static/Fonts/opensans/v6/k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');} @Font-face { Font-family: 'Open Sans'; Font-style: normal; Font-weight: 800; src: local('Open Sans Extrabold'),local('OpenSans-Extrabold'),url(http://themes.Googleusercontent.com/static/Fonts/opensans/v6/EInbV5DfGHOiMmvb1Xr-honF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');}
Perl 代码提取:
#!/usr/bin/perlwhile(<>){ if ($_=~m#url((.*))#){ @tmp=split(/ /,$1); if($tmp[0]=~m#((.*))#){ # print ; $data=$1; $data =~s#\(##g; $data =~s#\)##g; print "$data\n"; } } }总结
以上是内存溢出为你收集整理的Perl提取字体文件的URL全部内容,希望文章能够帮你解决Perl提取字体文件的URL所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)