- optimize
Return a new instance of the matcher that has been optimized.
- optimizeSinglePass
- combineAdjacentStart
Multiple adjacent start anchors can be reduced to a single start anchor.
- combineCharSeqAfterIndexOf
If a char sequence is adjacent to an index of matcher, then append the sequence
to the pattern of th
- combineCharSeqAfterStartsWith
If a char sequence is adjacent to a starts with matcher, then append the
sequence to the prefix patt
- convertEmptyCharClassToFalse
If a character class is empty, then it will not match anything and can be
treated as false.
- convertRepeatedAnyCharSeqToIndexOf
If a char sequence is preceded by a repeated any match, then replace with an
IndexOfMatcher. The ind
- convertSingleCharClassToSeq
If a character class has a single value, then just match that value ( "[a]" =>
"a"). This allows oth
- dedupOr
Remove duplicate branches in an OR clause. For example: "a|b|a" => "a|b".
- extractPrefixFromOr
Extract common prefix from OR clause. This is beneficial because it reduces the
amount that needs to
- flattenNestedOr
Nested OR clauses can be simplified to a just a simple set of options. For
example, "(a|b|(c|d|(e|f)
- flattenNestedSequences
Since we do not need to capture the contents, nested sequences can be simplified
to a just a simple