Tony Targonski
4/13/2005 5:16:00 PM
-----Original Message-----
From: Automat.Svet@gmail.com [mailto:Automat.Svet@gmail.com]
Sent: Wednesday, April 13, 2005 1:05 PM
To: ruby-talk ML
Subject: pattern matching question
I' mtrying to match a pattern like this one : 297,12^[2 where 297,12 is
the grand total.
Thanks in advance
automat_svet
----------------------------
your_text.scan(/([0-9]+,[0-9]+)\^\[2/)
Will return [["297,12"]], so you might want to stick a .flatten[0] in
there if you know you'll have only a single match.
--Tony