Snippets: Rails validates_format_of
August 31, 2007 @ 12:15 PM | posted by carmelyne
(last updated: 09.01.07)1 2 3 4 5 6 7 8 |
# email validates_format_of :email, :with => /(^([^@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i # url validates_format_of :url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix # password validates_format_of :password, :with => /^\w+$/ (alphanumeric) |
[ Last updated: September 01, 2007 @ 09:36 AM ]




Sorry, comments are closed for this article.