in reply to Get HTML::TokeParser::Simple to interpret some tags as text
Now you can filter your text in $text, for example like:my %allowed = ( u => 1, i => 1, b => 1); my $text = ""; while ( my $token = $p->get_token ) { if($token->is_text) { $text .= $token->as_is; } elsif($token->is_tag && $allowed{$token->get_tag}) { $text .= $token->as_is; } }
There is, of course, the chance that you'll match on the tags now.my @match = grep /$lookup/, split /\n/, $text; print "$_\n" foreach @match;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Get HTML::TokeParser::Simple to interpret some tags as text
by jonnyfolk (Vicar) on May 23, 2006 at 09:08 UTC |