Regex module

Skip

structSource

An unanchored start state usually goes back to itself on most bytes: the search is waiting for the first byte of a match. A vector search jumps to the next place a match could start. Without looks, any position will do as a restart (the start state does not depend on the byte before), so the search can use bytes from further into the match, at a fixed distance from its start: two of them, if no single one is rare. When every byte near the start is common, a rare byte that every match must contain will do: find it, then walk back over the bytes a match can have before it to where the match could start. With looks, it can only jump over bytes that keep the DFA in its start state.

Fields

computed: bool
state: u32
the start state, or UNKNOWN when nothing is skipped
kind: Skip_Kind
offset: int
from a match's start to the byte searched for (the first of a pair)
gap: int
PAIR and TRIPLE: from the first byte to the second
gap_3: int
TRIPLE: from the first byte to the third
count: int
BYTES: how many of bytes
bytes: [3] u8
second: Byte_Search.Byte_Set
PAIR, TRIPLE: the second byte; REQUIRED: the bytes a match can have before set
third: Byte_Search.Byte_Set
TRIPLE: the third byte
checks: int
BYTES, SET and PAIR without looks: the bytes a match can have at each of its first checks positions, as bit sets, checked before the DFA is given a candidate.
check: [FINGERPRINT_DEPTH][32] u8
exact: bool
Every match is exactly checks bytes, any of the checked bytes at each position: a candidate that fits the checks is the match, and the DFA need not run.

See also