Say I have a string: Hey what\'s up @dude, @how\'s it going?
Hey what\'s up @dude, @how\'s it going?
I\'d like to remove all the characters before@how\'s.
@how\'s
or with the regex:
str = "Hey what's up @dude, @how's it going?" str.gsub!(/.*?(?=@how)/im, "") #=> "@how's it going?"
you can read about lookaround at here