Socket
Socket
Sign inDemoInstall

domain-regex.js

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    domain-regex.js

JavaScript Domain Regex


Version published
Maintainers
1
Created

Readme

Source

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

FAQs

Last updated on 07 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc