From: Daniel N Date: 2007-08-13T13:38:46+09:00 Subject: Re: extract a number from a line of HTML file ------=_Part_11033_3970732.1186979930605 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/13/07, Ak 756 wrote: > > Daniel ----- wrote: > > On 8/13/07, Ak 756 wrote: > >> > >> Thanks very much. > >> -- > >> Posted via http://www.ruby-forum.com/. > > > > > > Your going to need to give some more information here. Using > > javascript? > > On the server side? Is it always that format? > > Hi Daniel > > I got this line from the body of NET::HTTP.post_form. I want to extract > the digital number embedded in this line. Actually ,I think I can do > this by remove all strings begin with "<" and end with ">". But I don't > know how to do. So server side... If you use the Hpricot Gem you can do this pretty easy. a = "123.20" value = Hpricot( a ).innerText.strip HTH Daniel ------=_Part_11033_3970732.1186979930605--