in reply to encode HTML entities with a regexp
Try this
use strict; my $input=' This is sample <This is sample text> This is sample <This is sample text <a>this is sample text</a> sam +ple text > '; my @arr=$input=~m#<[^<>]+(?:<a>.+?</a>[^<>]*)?>#g; local $"="\n"; print "\n@arr";
Output
<This is sample text> <This is sample text <a>this is sample text</a> sample text >
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: encode HTML entities with a regexp
by Ido (Hermit) on May 12, 2005 at 16:40 UTC |