Created
November 2, 2011 16:13
-
-
Save gdotdesign/1334062 to your computer and use it in GitHub Desktop.
Variable Types for renee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will not match and empty string. | |
register_variable_type(:required, /.+/) | |
# Password must be at least 4 characters, no more than 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit. | |
register_variable_type(:password, /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$/) | |
register_variable_type(:email, /\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]+\z/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment