fork(12) download
  1. class Ideone {
  2. static void main(String[] args) {
  3. def s="838123 someWord\n8 someWord\n12 someWord"
  4. def rx = /(\d+)\s*someWord/
  5. def res = s =~ rx
  6. (0..<res.count).each { println res[it][1] }
  7. }
  8. }
  9.  
Success #stdin #stdout 0.86s 4456448KB
stdin
Standard input is empty
stdout
838123
8
12