npm.io
1.0.19 • Published 3 years ago

regex-easy

Licence
ISC
Version
1.0.19
Deps
5
Size
6 kB
Vulns
0
Weekly
0

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

Contributing

Pull requests are always welcome. For bugs and feature requests, please create an issue.

Running Tests

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

Keywords