StartKind in regex_automata::dfa - Rust (original) (raw)

pub enum StartKind {
    Both,
    Unanchored,
    Anchored,
}

Available on crate feature dfa-search and (crate features dfa-search or dfa-onepass) only.

Expand description

The kind of anchored starting configurations to support in a DFA.

Fully compiled DFAs need to be explicitly configured as to which anchored starting configurations to support. The reason for not just supporting everything unconditionally is that it can use more resources (such as memory and build time). The downside of this is that if you try to execute a search using an Anchored mode that is not supported by the DFA, then the search will return an error.

§

Support both anchored and unanchored searches.

§

Support only unanchored searches. Requesting an anchored search will panic.

Note that even if an unanchored search is requested, the pattern itself may still be anchored. For example, ^abc will only match abc at the start of a haystack. This will remain true, even if the regex engine only supported unanchored searches.

§

Support only anchored searches. Requesting an unanchored search will panic.

§

§

§

§

§

§