|
发表于 2006-12-9 14:16:31
|
显示全部楼层
临时写的,你将就着用吧。假设你需要分析的文档是index.htm。
#!/usr/bin/perl -w
#
#
use FileHandle;
$htmlfh = new FileHandle("index.htm") || die "can not open index.htm because of $!\n";
local($/) = undef;
$html = <$htmlfh>;
#print $html;
while($html =~ m/<font color=red>(.*?)<\/font>/gs)
{
print $1,"\n";
}
close($htmlfh); |
|