On Jul 10, 2006, at 12:00 PM, Une bue wrote:

> studlee2 / gmail.com <studlee2 / gmail.com> wrote:
>
>> valid = /\d{2}/  #checks for exactly 2 digits
>
> this woundn't help because of gets.chomp returns always strings and
> gets.chomp.to_i returns Fixnum with 0 in case of any alpha betic  
> char in
> gets...

so check the regex before the to_i

need anchors though or "hi24" will pass

-- Elliot Temple
http://www.curi.us/blog/