From: Tim Mcd Date: 2009-01-15T02:44:21+09:00 Subject: Re: Regexp in Ruby Teme Rosi wrote: > names = ["My name is Jack"] > if names =~ /My name is (\w+)/i > puts $1 > end > > > What im trying to do with this code is to print rest of the line of the > same line where "My name is" is. But it doesnt work. Can anyone help? Hmm, that works for me. I don't know what the /i is for tho. If you need to tset out regexp's try www.rubular.com -- Posted via http://www.ruby-forum.com/.