From: Tony Targonski Date: 2005-04-14T02:16:03+09:00 Subject: Re: pattern matching question -----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