From: Matt Slay Date: 2010-12-15T07:15:06+09:00 Subject: Re: Split a string at a certain character > I would rather go with a combination of Peter's and Josh's solution: > > def parse(str) > if /\A(\d+(?:\.\d+)?)\s*([a-z]{1,2}\d+)\z/i =~ str > return Float($1), $2 > else > raise "Invalid input: %p" % str > end > end > > robert Thanks, all.. This has greatly solved many problems for me. However, I've notice that the server console is spitting out this message below with every request hit that comes in: warning: nested repeat operator + and ? was replaced with '*': /\A((?:\d+)?(?:\.\d+)?)\s*([a-z]{1,2}\d+)\z/ The whole process works fine, and but I am confused as to what this means. Also, one more question... what does that "i" mean at the very end of the regex pattern? "/...../i =! str" Is that what tells it to dump the results into the $1 and $2 variables? -- Posted via http://www.ruby-forum.com/.