Skip to content

Instantly share code, notes, and snippets.

@robbdimitrov
Last active October 8, 2017 10:10
Show Gist options
  • Save robbdimitrov/7562388 to your computer and use it in GitHub Desktop.
Save robbdimitrov/7562388 to your computer and use it in GitHub Desktop.
Regular expressions

Regular expressions

Phone number

^\\+?[0-9]{6,15}$

Email address

^[+\\w\\.\\-']+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,})+$

Simpler:

^[^@]+@[^@]+\.[^@]+$

Hashtag

(?:#){1}[\\w\\d]{1,140}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment