Skip to content

Instantly share code, notes, and snippets.

@gdotdesign
Created November 2, 2011 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdotdesign/1334062 to your computer and use it in GitHub Desktop.
Save gdotdesign/1334062 to your computer and use it in GitHub Desktop.
Variable Types for renee
# 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}$/)
# Email
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