Premade regex templates
Free and open-source for anyone to contribute!
Type | Support |
---|---|
commonjs | ✅ |
ES6 | ✅ |
Browser | ✅ |
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';
import { fastRegex } from 'fast-regex';
console.log(fastRegex('hasAlphanumeric').test('Hello world!'));
console.log(fastRegex('imgSrc').exec('<img src="hello-world.png">'));
fastRegex({
name: 'myCoolRegex',
regex: '[0-2]'
});
console.log(fastRegex('myCoolRegex').test('69'));
fastRegex({
name: 'myCoolRegexWithFlags',
regex: '[a-z]',
flags: 'g'
});
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')