From: Phrogz Date: 2007-06-07T06:30:16+09:00 Subject: Re: newbie question: deleting all of a string's contents BEFORE a certain character On Jun 6, 2:44 pm, superwick wrote: > Hi, > > I was trying to figure out how to take a string like this: "http://www.youtube.com/watch?v=QMuClxuWdH8" > and removing everything before (and including) the "=", creating a new > string with just "QMuClxuWdH8". irb(main):003:0> s = "http://www.youtube.com/watch?v=QMuClxuWdH8" => "http://www.youtube.com/watch?v=QMuClxuWdH8" irb(main):004:0> s =~ /[^=]+$/ => 31 irb(main):005:0> s[ /[^=]+$/ ] => "QMuClxuWdH8"