carol(source: string | RegExp): Pattern
Creates a new pattern from a RegExp or regex string.
seq(patterns: Pattern[]): Pattern
Creates a new pattern from a pattern sequence.
alt(patterns: Pattern[]): Pattern;
Creates a new pattern that tests for a match to one of the patterns.
constructor(source: string)
Pattern.many(min?: number, max?: number): Pattern
Pattern.many(opts: { min?: number, max?: number, length?: number, greedy?: boolean }): Pattern
Creates a new pattern that repeats the pattern.
Pattern.option(opts?: { greedy?: boolean }): Pattern
Create a new pattern that is allowed to not match the pattern.
Pattern.capture(): Pattern
Capture the pattern.
Pattern.toRegex(flags?: Flag | Flag[]): RegExp
Build a RegExp from the pattern.