0.0.4 • Published 2 years ago

pcremu v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

PCREmu

Build Status

PCRE emulation for JavaScript.

Usage

Example usage if consuming from outside an ES module:

$ npm i pcremu
const pcremu = require('pcremu').default;

// Create a matcher for your regex.
const matcher = pcremu.compile('^something');

// Match the regex against your input string.
const match = matcher.matchOne('something here');

console.log(match.getCaptureCount()); // Outputs "1".
console.log(match.getLength()); // Outputs "9" (the length of the word "something").

See also