in reply to convert characters
@valid_entities= ('a','abbr','acronym','br');# remove tags my %htmlenties = map { $_ =>1 } @valid_entities; $line =~ s/ < # a tag open ( # begin capture group 1 \/? # an optional slash ( # begin capture group2 [^>]*? any number of characters that aren't closing tags ) # end capture 2 \/? # an optional slash (xhtml and all that) ) # end capture group 1 > # a closing tag /exists $htmlenties{$2} ? "<$1>" : defined ($1) ? "<$1>" : "< +"/xeg;# different captures => different process
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: convert characters
by Anonymous Monk on Aug 27, 2009 at 12:37 UTC | |
by Utilitarian (Vicar) on Aug 27, 2009 at 12:39 UTC | |
by Anonymous Monk on Aug 27, 2009 at 16:26 UTC | |
by Utilitarian (Vicar) on Aug 27, 2009 at 18:17 UTC |