Table of Contents
Pattern Module
Pattern matching library that compiles string patterns to regular expressions.
Supports the following types of operation:
GLOB
: redis style glob match.REGEXP
: Javascript regular expression match.
The caveat is that when specifiying patterns with escape sequences (literal character match), unlike redis two backslashes are required as it is not possible to correctly get a single backslash in a javascript string due to it being treated as a string escape character.
Component of the jsr library.
Install
npm i jsr-pattern
API
Glob style:
var Pattern = ptn = ;console;
Regular expression style:
var Pattern = ptn = PatternREGEXP;console;
See the tests for more examples.
Developer
Test
Tests are not included in the package, clone the repository:
npm test
Documentation
To generate all documentation:
npm run docs
Readme
To build the readme file from the partial definitions (requires mdp):
npm run readme
License
Everything is MIT. Read the license if you feel inclined.
Generated by mdp(1).