I am trying to parse a multi line string and get the rest of the line following a pattern.
text:
hello john your username is: jj thanks for signing up
Not sure if it's any more Ruby'ish, but another option:
>> text = "hello john\nyour username is: jj\nthanks for signing up\n" >> text.match(/your username is: (.*)/)[1] => "jj"