s = "here is 1 theword here is 2"puts s.sub!(/(theword).*/mi, "\\1")
Standard input is empty
here is 1 theword
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!