From: Francisco Ortiz Date: 2006-05-06T02:56:16+09:00 Subject: Re: Noob Question - String Manipulation... ------=_Part_15745_3275751.1146851770325 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I've been using html_string.gsub(/<.*?>/,"") for this. But it's always seemed more a "perl way" than a "ruby way". On 5/5/06, Joseph Michaels wrote: > > On 5/5/06, Joe Cairns wrote: > > Hey, I'm pretty new to Ruby and am trying to absorb the "ruby way" of > > things as much as I can. What's the best way to solve this problem: > > > > I have a string that contains html formating. All I want is the plain > > text. > > > > I don't know of any libraries offhand that can do this (CGI only has > escape/unescape), but it's fairly simple: > > html_string.gsub(/<[^>]+>/, "") > > Replacing that regex with something better, probably. > > ------=_Part_15745_3275751.1146851770325--