Regex module

backtrack_search

procedure · 1 overloadSource

The first match at exactly start within text[start .. end], like an anchored pike_search, by depth-first search in priority order. Each (instruction, position) is tried once, so this is linear too, but it needs instructions * (end - start + 1) bits of memory: use it for short spans only (backtrack_fits).

backtrack_search :: (
    program: *Program,
    text: string,
    start: int,
    end: int,
    slots: [] int
) -> bool

The first match at exactly start within text[start .. end], like an anchored pike_search, by depth-first search in priority order. Each (instruction, position) is tried once, so this is linear too, but it needs instructions * (end - start + 1) bits of memory: use it for short spans only (backtrack_fits).

Parameters

program: *Program
text: string
start: int
end: int
slots: [] int

Returns

bool

See also