Types
Flag = enum flagCaseInsensitive, flagNotCaseInsensitive, flagMultiLine, flagNotMultiLine, flagAnyMatchNewLine, flagNotAnyMatchNewLine, flagUnGreedy, flagNotUnGreedy, flagUnicode, flagNotUnicode, flagVerbose, flagNotVerbose
Node = object kind*: NodeKind cp*: Rune next*: seq[int16] isGreedy*: bool uid*: NodeUid idx*: int16 isCapturing*: bool name*: string flags*: seq[Flag] min*, max*: int16 cps*: HashSet[Rune] ranges*: seq[Slice[Rune]] shorthands*: seq[Node] cc*: UnicodeCategorySet subExp*: SubExp
NodeKind = enum reChar, reCharCi, reJoiner, reGroupStart, reGroupEnd, reFlags, reOr, reZeroOrMore, reOneOrMore, reZeroOrOne, reRepRange, reStartSym, reEndSym, reStartSymML, reEndSymML, reStart, reEnd, reWordBoundary, reNotWordBoundary, reWord, reDigit, reWhiteSpace, reUCC, reNotAlphaNum, reNotDigit, reNotWhiteSpace, reNotUCC, reAny, reAnyNl, reWordBoundaryAscii, reNotWordBoundaryAscii, reWordAscii, reDigitAscii, reWhiteSpaceAscii, reNotAlphaNumAscii, reNotDigitAscii, reNotWhiteSpaceAscii, reInSet, reNotSet, reLookahead, reLookbehind, reNotLookahead, reNotLookbehind, reSkip, reEoe
NodeUid = int16
RegexFlag = enum regexArbitraryBytes, regexAscii, regexCaseless, regexDotAll, regexExtended, regexMultiline, regexUngreedy
RegexFlags = set[RegexFlag]
Consts
assertionKind = {reStartSym, reEndSym, reStartSymML, reEndSymML, reStart, reEnd, reWordBoundary, reNotWordBoundary, reWordBoundaryAscii, reNotWordBoundaryAscii, reLookahead, reLookbehind, reNotLookahead, reNotLookbehind}
groupKind = {reGroupStart, reGroupEnd}
groupStartKind = {reGroupStart, reLookahead..reNotLookbehind}
lookaheadKind = {reLookahead, reNotLookahead}
lookaroundKind = {reLookahead, reLookbehind, reNotLookahead, reNotLookbehind}
lookbehindKind = {reLookbehind, reNotLookbehind}
matchableKind = {reChar, reCharCi, reWord, reDigit, reWhiteSpace, reUCC, reNotAlphaNum, reNotDigit, reNotWhiteSpace, reNotUCC, reAny, reAnyNl, reInSet, reNotSet, reWordAscii, reDigitAscii, reWhiteSpaceAscii, reNotAlphaNumAscii, reNotDigitAscii, reNotWhiteSpaceAscii}
opKind = {reJoiner, reOr, reZeroOrMore, reOneOrMore, reZeroOrOne, reRepRange}
repetitionKind = {reZeroOrMore, reOneOrMore, reRepRange}
shorthandKind = {reWord, reDigit, reWhiteSpace, reUCC, reNotAlphaNum, reNotDigit, reNotWhiteSpace, reNotUCC, reWordAscii, reDigitAscii, reWhiteSpaceAscii, reNotAlphaNumAscii, reNotDigitAscii, reNotWhiteSpaceAscii}
Procs
func `$`(n: Node): string {....raises: [], tags: [].}
- return the string representation of a Node. The string is always equivalent to the original expression but not necessarily equal
func initEoeNode(): Node {....raises: [], tags: [].}
- return the end-of-expression Node. This is a dummy node that marks a match as successful
func initGroupStart(name: string = ""; flags: seq[Flag] = @[]; isCapturing = true): Node {....raises: [], tags: [].}
- return a reGroupStart node
func initJoinerNode(): Node {....raises: [], tags: [].}
- return a Node of reJoiner kind. Joiners are temporary nodes, they serve to generate the NFA but they are never part of it
func initNotSetNode(): Node {....raises: [], tags: [].}
- return a negated set Node, parsed from an expression such as [^a-z]
func initSetNode(): Node {....raises: [], tags: [].}
- return a set Node, parsed from an expression such as [a-z]
func initSkipNode(): Node {....raises: [], tags: [].}
func initSkipNode(next: openArray[int16]): Node {....raises: [], tags: [].}
- Return a dummy node that should be skipped while traversing the NFA
func isEpsilonTransition(n: Node): bool {.inline, ...raises: [], tags: [].}
func toCharNode(r: Rune): Node {....raises: [], tags: [].}
- return a Node that is meant to be matched against text characters
func toFlags(fls: RegexFlags): set[Flag] {....raises: [], tags: [].}
- Public flags to internal flags
func toFlagsSeq(fls: RegexFlags): seq[Flag] {....raises: [], tags: [].}