From: dblack@... Date: 2007-06-07T09:23:03+09:00 Subject: Re: newbie question: deleting all of a string's contents BEF Hi -- On Thu, 7 Jun 2007, Joshua Ballanco wrote: > Chad Wells wrote: >> That would work great if I was not worried that Youtube would change >> their URL scheme (it doesn't seem too likely, given the abundance of >> links out there, but should one ever fully count it out?). Not saying >> it'll even always have an equals sign in it and then the unique video >> indentifier at the end, either, so I guess it doesn't even matter! :-D >> >> Anyway, thanks everyone!! I am going to give "code = url.sub(/.*=/, >> "")" a shot to see how it works for me. >> >> -C > > Don't forget, regular expressions in Ruby are objects (...well, yes, > everything in Ruby is objects...). So, you could do something like: > > YOUTUBE_PARSER = Regexp.(/\w+$/) Actually it's even easier: YOUTUBE_PARSER = /\w+$/ :-) David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)