def s = "This is a simple string 234 something else here as well 4334" def m = s =~ /[0-9]{3}/(0..<m.count).each { print m[it] + '\n' }
Standard input is empty
234 433
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!