1.1.1 • Published 1 year ago

fast-regex v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

🔮 JavaScript Support

TypeSupport
commonjs
ES6
Browser

⚙️ Installation

npm i fast-regex

CDN Links:

If you are using npm to install it and then running it on the browser then use:

import fastRegex from './node_modules/fast-regex/fastRegex.js';

📖 Documentation

▸ Example code:

import { fastRegex } from 'fast-regex';

console.log(fastRegex('hasAlphanumeric').test('Hello world!'));

console.log(fastRegex('imgSrc').exec('<img src="hello-world.png">'));

▸ Add your own regex:

fastRegex({
    name: 'myCoolRegex',
    regex: '[0-2]'
});

console.log(fastRegex('myCoolRegex').test('69'));

▸ Add your own regex with flags:

fastRegex({
    name: 'myCoolRegexWithFlags',
    regex: '[a-z]',
    flags: 'g'
});

▸ All regex codes:

fastRegex('validEmail')
fastRegex('ipv4')
fastRegex('ipv6')
fastRegex('hasInteger')
fastRegex('hasAlphanumeric')
fastRegex('validPhone')
fastRegex('imgSrc')
fastRegex('validZipCode')
fastRegex('validTwitterUsername')
fastRegex('domain')
fastRegex('removeHtmlComments')
fastRegex('isPositiveInteger')
fastRegex('isNegativeInteger')
fastRegex('validCreditCard')

Support me on Patreon - Check out my socials