Make a parser that uses regular expressions
to match/non-match characters belonging to a certain range
or having a certain unicode property.
Provide a positive expression to accept only characters that satisfy it.
Provide a negative expression to reject characters that satisfy it.
If both are given a character must match positive (when provided) AND must NOT match negative (when provided).
At least one of the arguments must be provided (throws otherwise).
Use satisfy from core module instead if you need an arbitrary predicate.
Tokens expected to be individual characters / graphemes.
Type Parameters
TOptions
Parameters
positive: undefined|RegExp
Regular expression that must match (optional).
Optionalnegative: RegExp
Regular expression that must not match (optional).
Make a parser that uses regular expressions to match/non-match characters belonging to a certain range or having a certain unicode property.
Provide a
positive
expression to accept only characters that satisfy it. Provide anegative
expression to reject characters that satisfy it. If both are given a character must matchpositive
(when provided) AND must NOT matchnegative
(when provided).At least one of the arguments must be provided (throws otherwise).
Use
satisfy
from core module instead if you need an arbitrary predicate.Tokens expected to be individual characters / graphemes.