Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi !
I think this does what you want:
I first create the string $tagpattern by putting a "|" between all known HTML tags and surrounding the whole thing with parantheses. This will give something like "(a|p|code.....)" and is used later in the subroutine to check for valid HTML tags. The regex looks a bit complicated and I am sure that it can be written much better, but I believe it is sufficient for your cause. Note that this will only work for tags that are on one line and could get you into trouble if there are < or > signs inside a tag (Don't know if this is possible in HTML). update:It would propably be a lot wiser to use Ovid's code then my homegrown regex.---- kurt In reply to Re: Re: Re: Re: Re: Strip HTML tags again
by amphiplex
|
|