From: 7stud -- Date: 2007-10-31T05:33:16+09:00 Subject: Re: HTML parser Hpricot? and how to get all text SpringFlowers AutumnMoon wrote: > > in > http://code.whytheluckystiff.net/hpricot/wiki/HpricotChallenge#StripallHTMLtags > it says just use > > str=doc.to_s > print str.gsub(/<\/?[^>]*>/, "") > > but can't the < > be nested in some HTML code? If it is nested then > the above won't work, it seems. What do you mean by nested? I would consider your example as containing nested tags: hello world" and the regex removes all the tags from that string. html can look like this: hel>llo>>worl What do you want to do with that string? -- Posted via http://www.ruby-forum.com/.