Begin forwarded message:
James G. wrote:
revision: 20080118
text = STDIN.read
(text.length/2).downto 1 do |l|
match = Regexp.new("(.{#{l}})\1").match(text)
while fail with text longer than (1 << 15)-1 which is the maximum string
a quantifier can handle.