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:

<b>hello <i>world</i></b>"

and the regex removes all the tags from that string.  html can look like 
this:

<h2<p>hel<b<i>></h2<b>llo<h1<b<i>>>worl</i><b></h1>

What do you want to do with that string?

-- 
Posted via http://www.ruby-forum.com/.