Showing posts with label domain-name-validator. Show all posts
Showing posts with label domain-name-validator. Show all posts

Thursday, November 16, 2017

JavaScript Regex To Match Domain Name | Domain Validator Regex

Below is the required regex to validate any domain name, its simple so you can modify if you need to extend it.

^((http|https):\/\/)?([a-zA-Z0-9_][-_a-zA-Z0-9]{0,62}\.)+([a-zA-Z0-9]{1,10})$