Strinpping html using regexp

A

Arun Kumar

Hi,
I want to remove the all html tags in a string using regexp. But the
main thing is I dont want to use gsub or any other methods for it. I
want pure regexp to fetch the data other than the html tags. Can anybody
please give me the code.

Thanks
Arun
 
B

badboy

Arun said:
Hi,
I want to remove the all html tags in a string using regexp. But the
main thing is I dont want to use gsub or any other methods for it. I
want pure regexp to fetch the data other than the html tags. Can anybody
please give me the code.

Thanks
Arun
1. regular expressions are not good for stripping html code, use a HTML Parser
(Nokogiri, Hpricot, ...)
2. if you want to use regexp, why not gsub? o_O what do you mean by "pure
regexp"? gsub can strip content based on regular expressions. I don't get your
point here.
3. ....
 
M

Mark Thomas

Hi,
   I want to remove the all html tags in a string using regexp.

No, you really really don't. Trust me.
I want pure regexp to fetch the data other than the html tags.

If you had said "pure XPath", then that would make sense.

-- Mark.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top