Package Exports
- pcremu
- pcremu/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pcremu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
PCREmu
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").