Skip to content

Instantly share code, notes, and snippets.

@humphd
Created September 23, 2020 15:50
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 humphd/584fb474be78adce65628a6ff3dfb761 to your computer and use it in GitHub Desktop.
Save humphd/584fb474be78adce65628a6ff3dfb761 to your computer and use it in GitHub Desktop.
WEB222 Week 3 RegExp
name@server.com
web222@gmail.ca
(\w+)@([\w.]+)
491 5050
(416) 491 5050
(416) 491-5050
416-491-5050
416 491 5050
416 4915050
416 491 5050
4164915050
(416)4915050
(416) 491 5050
(\(?\d{3}\)?[-\s]*)\d{3}[-\s]*\d{4}
? - optional (0 or 1)
* - 0 or more
+ - 1 or more
{5} - exactly 5
{5,7} - between 5 and 7
^ - look from the beginning of the input string
$ - match at the end of the input string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment