I have tested a simpler version and noticed this:

ruby-1.9.2-p136 :010 > /^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/ =~ 
"1234567890"
 => 0 
ruby-1.9.2-p136 :011 > /^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/ =~ 
"(123)4567890"
 => 0 
ruby-1.9.2-p136 :012 > /^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/ =~ 
"(123) 456-7890"
 => 0 
ruby-1.9.2-p136 :013 > /^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/ =~ 
"(123)3456-7890"
 => nil 
ruby-1.9.2-p136 :014 > /^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/ =~ 
"(123)-456-7890"
 => 0 
ruby-1.9.2-p136 :015 > /^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/ =~ 
"(123) 456-7890 smurf"
 => nil 
ruby-1.9.2-p136 :016 > 


does 0 mean pass? And is then the validated_with not accepting 0 as a pass?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to