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
I want to extract jj, aka everything after "your username is: "
One way:
text = "hello john\nyour username is: jj\nthanks for signing up\n"
match = text[/your username is: (.*)/]
value = $1
But this reminds me of perl... and doesn't "read" as naturally as I am told ruby should.
Is there a cleaner way? AKA A "ruby" way?
Thanks