From: James Gray Date: 2008-01-21T00:58:35+09:00 Subject: Fwd: Please Forward: Ruby Quiz Submission Begin forwarded message: > From: Yoan Blanc > Date: January 18, 2008 1:18:37 PM CST > To: submission@rubyquiz.com > Subject: Please Forward: Ruby Quiz Submission > > thanks. > #!/usr/bin/ruby > # author: Yoan Blanc > # revision: 20080118 > > text = STDIN.read > > (text.length/2).downto 1 do |l| > match = Regexp.new("(.{#{l}})\\1").match(text) > if match > puts text[match.offset(1)[0]..(match.offset(1)[1]-1)] > break > end > end