Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

safe-regex-test 1.0.3

Give a regex, get a robust predicate function that tests it against a string.
Package summary
Share
0
issues
0
licenses
Package created
22 Sep 2022
Version published
6 Feb 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does safe-regex-test do?

The "safe-regex-test" npm package allows users to obtain a robust predicate function that tests a regular expression against a string. This package works seamlessly even if the RegExp.prototype is altered at a later stage, ensuring a high level of reliability in testing regular expressions.

How do you use safe-regex-test?

To use the "safe-regex-test" package, first, install it via npm with the command npm install --save safe-regex-test. Next, require the package in your JavaScript file and create a tester using the regex you want to test. Here is a JavaScript code example showing how to use "safe-regex-test":

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

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

In this sample JavaScript code, the regular expression tester is created with the expression 'a'. It is then tested against the characters 'a' and 'b', with the result being true for 'a' and false for 'b', thus displaying the functionality of the "safe-regex-test" package.

Where are the safe-regex-test docs?

The "safe-regex-test" package's documentation, including the basic usage and installation instructions, can be found within the main README file in the package's GitHub repository, located at https://github.com/ljharb/safe-regex-test.git. This repository includes all necessary details regarding the "safe-regex-test" npm package, providing an excellent resource for developers who are looking to get started with, or improve their understanding of, the package.