validate-regexp

const regex = require('validate-regexp');

Usage no npm install needed!

<script type="module">
  import validateRegexp from 'https://cdn.skypack.dev/validate-regexp';
</script>

README

Common regular expressions

Usage

const regex = require('validate-regexp');

regex.url.test('http://www.abc.com') // =>true