SHARE
TWEET

Untitled

a guest Feb 22nd, 2012 30 Never
  1. #!/usr/bin/env ruby
  2.  
  3. url = ('http://www.tvrage.com/NCIS/episodes/720720/')
  4.  
  5.  
  6. if url.match(/(http:\/\/|#{nil})(.+)\/(.+?)\/episodes\/(\d+)(\/?)$/) then
  7.  
  8.   puts 'Domain = ' + $2
  9.   puts 'Show = ' + $3
  10.   puts 'Number = ' + $4
  11.   puts "Found"
  12.  
  13. end
RAW Paste Data
Top