fork download
  1. STDIN.read.split("\n").each do |nextline|
  2. if nextline =~ /^.+\/(.+)\/.+\/?$/
  3. printf("matched %s in %s\n", $~[1], nextline);
  4. else
  5. puts "no match"
  6. end
  7. end
Success #stdin #stdout 0s 28688KB
stdin
http://w...content-available-to-author-only...e.com/value/1234/different-value
http://w...content-available-to-author-only...e.com/value/1234/different-value/
stdout
matched 1234 in http://w...content-available-to-author-only...e.com/value/1234/different-value
matched 1234 in http://w...content-available-to-author-only...e.com/value/1234/different-value/