Struct regex::internal::ExecBuilder[][src]

pub struct ExecBuilder {
    options: RegexOptions,
    match_type: Option<MatchType>,
    bytes: bool,
    only_utf8: bool,
}

Facilitates the construction of an executor by exposing various knobs to control how a regex is executed and what kinds of resources it's permitted to use.

Fields

Methods

impl ExecBuilder
[src]

Create a regex execution builder.

This uses default settings for everything except the regex itself, which must be provided. Further knobs can be set by calling methods, and then finally, build to actually create the executor.

Like new, but compiles the union of the given regular expressions.

Note that when compiling 2 or more regular expressions, capture groups are completely unsupported. (This means both find and captures wont work.)

Create a regex execution builder.

Set the matching engine to be automatically determined.

This is the default state and will apply whatever optimizations are possible, such as running a DFA.

This overrides whatever was previously set via the nfa or bounded_backtracking methods.

Sets the matching engine to use the NFA algorithm no matter what optimizations are possible.

This overrides whatever was previously set via the automatic or bounded_backtracking methods.

Sets the matching engine to use a bounded backtracking engine no matter what optimizations are possible.

One must use this with care, since the bounded backtracking engine uses memory proportion to len(regex) * len(text).

This overrides whatever was previously set via the automatic or nfa methods.

Compiles byte based programs for use with the NFA matching engines.

By default, the NFA engines match on Unicode scalar values. They can be made to use byte based programs instead. In general, the byte based programs are slower because of a less efficient encoding of character classes.

Note that this does not impact DFA matching engines, which always execute on bytes.

When disabled, the program compiled may match arbitrary bytes.

When enabled (the default), all compiled programs exclusively match valid UTF-8 bytes.

Set the Unicode flag.

Parse the current set of patterns into their AST and extract literals.

Build an executor that can run a regular expression.

Auto Trait Implementations

impl Send for ExecBuilder

impl Sync for ExecBuilder