Skip to content

Instantly share code, notes, and snippets.

@ryenski
Created April 21, 2010 16:12
Show Gist options
  • Save ryenski/374028 to your computer and use it in GitHub Desktop.
Save ryenski/374028 to your computer and use it in GitHub Desktop.
# From http://zylstra.wordpress.com/2008/03/12/a-kinder-gentler-phone-number-validation/
validates_format_of :phone,
:message => "must be a valid telephone number.",
:with => /^[\(\)0-9\- \+\.]{10,20} *[extension\.]{0,9} *[0-9]{0,5}$/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment