in reply to How can use Perl to strip away some nested HTML markup code, like <SCRIPT> ?
You could use this:<b>I like</b> <i>squirrels!</i>.
To turn it into this:$html =~ s/<[^>]*>([^<]*)<\/[^>]*>/$1/gs;
{QandAEditors note: merlyn points out by way of followup that the above regexp only works for simple HTML, and that in real life HTML, the regexp can't be counted upon to not fail. See the followup for details. }I like squirrels.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Answer: How can use Perl to strip away some nested HTML markup code, like <SCRIPT> ?
by merlyn (Sage) on Oct 15, 2003 at 15:02 UTC |