Enum regex_automata::dfa::StartKind
source · pub enum StartKind {
Both,
Unanchored,
Anchored,
}
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.
Variants§
Both
Support both anchored and unanchored searches.
Unanchored
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.
Anchored
Support only anchored searches. Requesting an unanchored search will panic.