safe-regex-test <sup>Version Badge</sup>

github actions coverage License Downloads

npm badge

Give a regex, get a robust predicate function that tests it against a string. This will work even if RegExp.prototype is altered later.

Getting started

npm install --save safe-regex-test

Usage/Examples

var regexTester = require('safe-regex-test');
var assert = require('assert');

var tester = regexTester('a');
assert.ok(tester('a'));
assert.notOk(tester('b'));

Tests

Simply clone the repo, npm install, and run npm test

safe-regex-test - Installation

To install safe-regex-test via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install safe-regex-test --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install safe-regex-test

Learn more about the config option.

PNPM

pnpm install safe-regex-test --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install safe-regex-test --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

safe-regex-test - Download

Download Tarball (v1.1.0)

Integrity sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==
SHASUM 7f87dfb67a3150782eaaf18583ff5d1711ac10c1
Tarball https://js.registry.sudovanilla.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz