Last active
May 22, 2020 19:11
-
-
Save wizard04wsu/369bc03c6023822f9ca86506cd337bec to your computer and use it in GitHub Desktop.
Regular expressions
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
Phone numbers: | |
https://gist.github.com/wizard04wsu/11458504 | |
Email validation (complex): | |
^((?:[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+(?:\.[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+)*)|(?:"(?:(?:(?:(?:[\t ]*\r?\n)?[\t ]+)?(?:[!#$%&'()*+,\-./0-9:;<=>?@A-Z[\]^_`a-z{|}~]|\\[\t !-~])+)+(?:(?:[\t ]*\r?\n)?[\t ]+)?|(?:(?:[\t ]*\r?\n)?[\t ]+))"))@(\d+(?:\.\d+){3}|\[(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){5}:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|\d+(?:\.\d+){3})|(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)\]|(?:[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)(?:\.[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)*)$ | |
Email validation (simpler): | |
^((?:[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+(?:\.[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+)*)|(?:"(?:[!#$%&'()*+,\-./0-9:;<=>?@A-Z[\]^_`a-z{|}~\t ]|\\[\t !-~])+"))@([A-Za-z-][0-9A-Za-z-]*(?:\.[A-Za-z-][0-9A-Za-z-]*)*|\d+(?:\.\d+){3}|\[[0-9A-Fa-f:.]+\])$ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment