CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Strip html tags

 



mmcw
User

Dec 4, 2000, 9:38 AM

Post #1 of 2 (428 views)
Strip html tags Can't Post

I have the following word:

<b>test</b>isthis

I want to strip the html tags so I get:

testisthis

How to do that?


sleuth
Enthusiast

Dec 5, 2000, 10:33 AM

Post #2 of 2 (428 views)
Re: Strip html tags [In reply to] Can't Post

 Say you stored the html in $html, then do this,

$html =~ s!<(.*?)>!!g;

Just a regex, you can read more about regex in the perl docs or at perl.com.

Sleuth

[This message has been edited by sleuth (edited 12-05-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives