regex-easy
v1.0.19
Published
simple regular expression utility for node
Downloads
42
Readme
Simple and easy regular expression utility for node
Using npm:
$ npm i -g npm
$ npm i --save regex-easy
In Node.js:
// Load the package
let re = require('regex-easy');
Usage
- Regular expression usage
let r = new re.regex(pattern[string], flags[optional|string], escape[optional|boolean]);
// Methods
r.exec(string) //executes a search for a match in a string. It returns an array of information or null on a mismatch.
r.test(string) // method that tests for a match in a string. It returns true or false.
- Independent Methods
re.escape(string); // Escaping user input that is to be treated as a literal string within a regular expression—that would otherwise be mistaken for a special character
To read more about regular expressions
About
Pull requests are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm i --save regex-easy && cd node_modules/regex-easy/ && npm test && cd ../../
Author
Sameer Saini
Let's connect