RE: Best way to selectively strip HTML tags

2005-02-24 Thread Chad I. Uretsky
After I sent my original e-mail, I decided it might be better to stick with something more along the lines of your original regexp. So the following will work as well, and actually better, since it will also eliminate your custom tags if anything other than the tag name is entered (this is accompl

RE: Best way to selectively strip HTML tags

2005-02-24 Thread Chad I. Uretsky
I did a program once that only allowed certain tags and then removed all others. It seems easiest to permit the tags you want, and remove all others, so for your needs, I think the following will suffice: $allowed_tags = "TYPE|DESCRIPTION"; s/<(?!$allowed_tags).*?>//gis; I gave t

Re: Best way to selectively strip HTML tags

2005-02-24 Thread Craig Cardimon
Thank you. I'll try it. By the way, how is your first name pronounced? Petr Vileta wrote: - Original Message - From: "Craig Cardimon" <[EMAIL PROTECTED]> To: "ActivePerl" Sent: Thursday, February 24, 2005 3:01 PM Subject: Best way to selectively strip HTML tags I need to strip HTML-styl

Re: Best way to selectively strip HTML tags

2005-02-24 Thread Petr Vileta
- Original Message - From: "Craig Cardimon" <[EMAIL PROTECTED]> To: "ActivePerl" Sent: Thursday, February 24, 2005 3:01 PM Subject: Best way to selectively strip HTML tags > I need to strip HTML-style "<" and ">" tags and their contents from > ASCII text while not disturbing customized

Best way to selectively strip HTML tags

2005-02-24 Thread Craig Cardimon
I need to strip HTML-style "<" and ">" tags and their contents from ASCII text while not disturbing customized tags that might say or . Is there a way to do this without going bonkers? I'm using *** s/<(?:[^>'"]*|(['"]).*?\1)*>//gs; *** to strip all angle braces from the text. It works like gan