Last active
April 29, 2021 06:57
-
-
Save oskarnrk/23ff0c8a510428a51fa700b551623797 to your computer and use it in GitHub Desktop.
Check if is a valid URL
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
const validEmailRegexp = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i; | |
const isValidEmail = email => validEmailRegexp.test(email); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment