Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

RE: Re: HTML Tag Remover

by nardo (Friar)
on Aug 06, 2000 at 22:50 UTC ( #26441=note: print w/replies, xml ) Need Help??


in reply to Re: HTML Tag Remover
in thread HTML Tag Remover

That wouldn't work for html such as
<img src="whatever.gif" alt=">>>Click Here<<<">

Replies are listed 'Best First'.
RE: RE: Re: HTML Tag Remover
by lolindrath (Scribe) on Aug 07, 2000 at 02:37 UTC
    Ok, I added this line before the other regex and it seemed to work, though it is a little specific to that problem. it simple removes anything that has more than one pointy bracket after it. If you want to keep these in you can always replace it with some character and replace it with the pointy brackets after its done with the html tag stripping. This is the revised code
    #!/usr/bin/perl -w open FILE, "c:\\html\\test.html" || die "can't open file"; @text = <FILE>; $text = join( "", @text ); close FILE; #print $text; $text =~ s/>[>+]//g; # < -- Added this line $text =~ s/\<(.*?)\>//sg; print $text;


    --=Lolindrath=--

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://26441]
help
Chatterbox?
[Discipulus]: I still use but I also attract many critics for this: I use when I call subs defined in the very same file, just to recognize them. You can avoid (but sometimes is needed)
[marto]: believe it or not this is a SPAM account :P
[Discipulus]: it seems a legitimate one.. grin ..

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-05-22 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?