@essentialib/pattern
v1.0.0-beta
Published
Easy handling of JavaScript regular expressions.
Downloads
1
Maintainers
Readme
pattern
Easy handling of JavaScript regular expressions.
install & import
npm install @essentialib/pattern
const Pattern = require("@essentialib/pattern");
example
// same as /-?(\d+)/
const isInteger = Pattern(_ => _
.maybe('-')
.capture(g1 => g1
.digit().oneOrMore()
)
);
console.log(isInteger.test('-34')); // true