我想删除@之前的所有字符.
str = "Hey what's up @dude,@how's it going?" str.gsub!(/.*?(?=@how)/im,"") #=> "@how's it going?"
您可以阅读关于here的回顾