Dan Jacobson <jidanni (AT) jidanni (DOT) org> wrote:
Quote:
Is my HTML tag stripper up to par? |
It can strip things that are not tags and not strip things
that are tags.
It can fail for most of the situations shown in the FAQ answer.
Quote:
$ cat striptag
#!/usr/bin/perl -w
#usage example: striptag font div < file.html
read( STDIN, $_, -s STDIN );
foreach my $tag (@ARGV) { s@</?$tag.*?>@@sig }
print; |
Ask it to strip the img tags from this:
<img src="cool.jpg" alt=">>Cool Pic!<<">
<!-- <img>no img tag here!</img> -->
--
Tad McClellan SGML consulting
tadmc (AT) augustmail (DOT) com Perl programming
Fort Worth, Texas