【发布时间】:2012-05-18 04:58:15
【问题描述】:
如何打印从出现开始的文本 reg 表达式 $START_REGEX 直到 $END_REGEX?
#!/usr/bin/perl -w
use strict;
use warnings;
package HTMLStrip;
use base "HTML::Parser";
use LWP::Simple;
my $START_REGEXP = 'To the current program';
my $END_REGEXP = 'Please choose';
sub text {
my ($self, $text) = @_;
print $text;
}
my $p = new HTMLStrip;
$p->parse_file("index.html");
$p->eof
【问题讨论】: