Why doesn't this phone validation work?

validates_format_of :phone, :with => /^\([0-9]{3}\)[-. ]?[0-9]{3}[-. 
]?[0-9]{4}|^[0-9]{3}[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/,
                      :message => "is not a phone number"

tested with (123) 456 7890

testing it here does work: http://www.rubular.com/ but in a rails app, it 
fails validation except for 1234567890

-- 
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