Extract a number from a line of HTML file

Hi,

I have a line of HTML file like this

123.20

I want to remove all such HTML tags as ‘’ and only get the 123.20.

Would anyone kindly tell me how?

Thanks very much.

On 8/13/07, Ak 756 [email protected] 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?

Daniel ----- wrote:

On 8/13/07, Ak 756 [email protected] 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.

On 8/13/07, Ak 756 [email protected] wrote:

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

Daniel ----- wrote:

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

Hi Daniel

Thanks! Great gem! It’s exactly what I want, and so simply!
Thanks very much.

ak756