str = "1 - hello world 1234 abc 5678 def"puts str[/\d+\D+(\d+\s*\w+)/, 1]puts str[/\d+\D+\K\d+\s*\w+/]
Standard input is empty
1234 abc 1234 abc
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!