Skip to content

Instantly share code, notes, and snippets.

@cesarfigueroa
Last active December 17, 2015 23:19
Show Gist options
  • Save cesarfigueroa/5688172 to your computer and use it in GitHub Desktop.
Save cesarfigueroa/5688172 to your computer and use it in GitHub Desktop.
Ruby email regular expression
EMAIL_ADDRESS = /\A[A-z0-9._%+-]+@[A-z0-9.-]+\.[A-z]{2,4}\z/
@cesarfigueroa
Copy link
Author

Using \A and \z instead of ^ and $ per the recommendation of Bryan Helmkamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment