in reply to Re: How do I regex for characters like ¾, ¼ ?
in thread How do I regex for characters like ¾, ¼ ?
... so I have a sub text() that looks like this ...my $p = HTML::Parser->new( api_version => 3, start_h => [\&start, "tagname, attr"], end_h => [\&end, "tagname"], text_h => [\&text, "dtext"], marked_sections => 1, ); # Parse directly from file $p->parse_file($inputFile);
... so when should I do the "local $/;" call?sub text { my($origtext, $is_cdata) = @_; if ( $origtext =~ /^\s*$/ ) { return; } $origtext = "UNDEF" if !defined $origtext; $is_cdata = "UNDEF" if !defined $is_cdata; $origtext =~ s/ \& / \& /g; $origtext =~ s/½/\½/g; print $origtext; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do I regex for characters like ¾, ¼ ?
by Anonymous Monk on Sep 10, 2007 at 04:19 UTC | |
by Plankton (Vicar) on Sep 10, 2007 at 04:26 UTC | |
|
Re^3: How do I regex for characters like ¾, ¼ ?
by GrandFather (Saint) on Sep 10, 2007 at 04:10 UTC |