r = /\$(?<dollars>\d+)\.(?<cents>\d+)/s = '$3.67' if r =~ s then puts dollars puts centsend
Standard input is empty
Standard output is empty
prog.rb:5:in `<main>': undefined local variable or method `dollars' for main:Object (NameError)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!