From: "Derrick B." Date: 2012-12-22T12:55:34+09:00 Subject: Re: Perl to Ruby: regex captures to assignment. 7stud -- wrote in post #1089801: >By the way, if you haven't played with Rubular, you > should > give it a try: > > http://rubular.com/ I have found that. Good tool to use. Also, I am still trying to wrap my head around the line terminating error I showed you. I want to try other scenarios besides conditional operators to see what happens. Lastly, I reduced my assignment statement to two lines: %r{(?:([-]?\d+)\s*)??([-]?\d+)(/)(\d+)}xms =~ frac w, n, d = $3 ? [$1.to_i, $2.to_i, $4.to_i] : [1, frac.to_i, 0] ... which adds the slash check, rather than using a separate regex. Probably still "weird", but that's ok. :) I think I need to start a new thread with new material. 20+ entries is probably enough. For now, I'm on chapter nine of "The Ruby Programming Language", which is an in-depth tour of Ruby syntax. Good stuff. -- Posted via http://www.ruby-forum.com/.