s = "String1 Delim String2 deliM String3"puts s.split(/\bdelim\b/i, 2)
Standard input is empty
String1 String2 deliM String3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!