0.0.1 • Published 6 years ago

domain-regex.js v0.0.1

Weekly downloads
3
License
-
Repository
-
Last release
6 years ago

domain-regex.js

JavaScript Domain Regex

License: MIT

Installation

<script src="domain-regex.js"></script>

or

npm install --save domain-regex.js
require('domain-regex.js');

Usage

// false
domainRegex.test('htt://githubcom');
domainRegex.test('http://githubcom');
domainRegex.test('http//githubcom');
domainRegex.test('http:/githubcom');
domainRegex.test('http:/github.com123');
domainRegex.test('22http://github.com');

// true
domainRegex.test('github.com');
domainRegex.test('http://github.com');
domainRegex.test('http://www.github.com');
domainRegex.test('https://github.com');
domainRegex.test('https://www.github.com');

// Unicode Domains
domainRegex.test('짧.한국');
domainRegex.test('http://짧.한국');
domainRegex.test('https://www.facebook.com/소행성-소녀-387632298355712');

License

MIT

Author

Young Jae Sim