HighDots Forums  

Re: is my HTML tag stripper up to par?

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Re: is my HTML tag stripper up to par? in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tad McClellan
 
Posts: n/a

Default Re: is my HTML tag stripper up to par? - 08-24-2003 , 07:18 PM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.