# Fwd: Please Forward: Ruby Quiz Submission

**URL:** <https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229161>\
**Category:** Ruby\
**Created:** [January 20, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229161 "2008-01-20T17:00:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [January 20, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229161/1 "2008-01-20T17:00:29Z")

</div>

Begin forwarded message:

---

<div class="post-metadata">

**Author:** ![bbazzarrakk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Post date:** [January 20, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229161/2 "2008-01-20T20:52:54Z")

</div>

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.
