[Rails] Multiple regex match in the same line

2012-04-23 Thread Loren
Hi, Could somebody please show me a way to find, and display multiple regex matches in the same line? Like this: test_string = "I shot the Sherrif but I didn't shot the Deputy." The word I would like to find is the "shot" and displayed like "shotshot" or like each match could go into a new line

[Rails] Multiple regex match in the same line

2012-04-23 Thread Loren
Hi, Could somebody please show me a way to find, and display multiple regex matches in the same line? Like this: test_string = "I shot the Sherrif but I didn't shot the Deputy." # The word I would like to find is the "shot" and displayed like "shotshot" or like each match could go into a new #li