fork(1) download
  1. r = /\$(?<dollars>\d+)\.(?<cents>\d+)/
  2. s = '$3.aa'
  3.  
  4. if match_data = r.match(s) then
  5. puts match_data[:dollars]
  6. puts match_data[:cents]
  7. else
  8. puts 'no match'
  9. end
  10.  
Success #stdin #stdout 0.01s 6120KB
stdin
Standard input is empty
stdout
no match