Match words, numbers and dates in text documents.
const text_match = ;const match = text_match;const v = ;if vconsole;console;console;elseconsole;
matcher(map[, config]): Creates a matcher for the given map of expressions. All entries in the map have to match. Returns a function that receives
(text). The returned function will return the matched values or
null. The optional config is passed to the expressions and may have these common properties:
expressions: A map of custom expressions.
expression(regex[, fn]): Creates a new custom expression from a regular expression. The first group in the regular expression is used to extract the value unless
fnis given. If
fnis given, it is invoked with
(match, config)and is expected to return the extracted value. If
nullis returned, the expression does not match. These default aliases are supported:
WORD: Returns a string
WORDS: Returns a string
NUMBER: Returns a string
PERCENT: Returns a string
DATE: = Returns a moment.js date object