Regex module

dfa_find_end

procedure · 1 overloadSource

The end of the leftmost-first match that starts at or after start (and exactly at start if anchored), or -1. With earliest, stops at the first position where any match ends, which answers "is there a match" sooner. gave_up means the DFA grew past its limit and the caller has to use another matcher.

dfa_find_end :: (
    d: *Dfa,
    text: string,
    start: int,
    anchored: bool,
    earliest: bool
) -> (end: int, gave_up: bool)

The end of the leftmost-first match that starts at or after start (and exactly at start if anchored), or -1. With earliest, stops at the first position where any match ends, which answers "is there a match" sooner. gave_up means the DFA grew past its limit and the caller has to use another matcher.

Parameters

d: *Dfa
text: string
start: int
anchored: bool
earliest: bool

Returns

end: int
gave_up: bool

See also