Struct regex_syntax::ExprBuilder[][src]

pub struct ExprBuilder { /* fields omitted */ }
Expand description

A builder for configuring regular expression parsing.

This allows setting the default values of flags and other options, such as the maximum nesting depth.

Implementations

Create a new builder for configuring expression parsing.

Note that all flags are disabled by default.

Set the default value for the case insensitive (i) flag.

Set the default value for the multi-line matching (m) flag.

Set the default value for the any character (s) flag.

Set the default value for the greedy swap (U) flag.

Set the default value for the ignore whitespace (x) flag.

Set the default value for the Unicode (u) flag.

If yes is false, then allow_bytes is set to true.

Whether the parser allows matching arbitrary bytes or not.

When the u flag is disabled (either with this builder or in the expression itself), the parser switches to interpreting the expression as matching arbitrary bytes instead of Unicode codepoints. For example, the expression (?u:\xFF) matches the codepoint \xFF, which corresponds to the UTF-8 byte sequence \xCE\xBF. Conversely, (?-u:\xFF) matches the byte \xFF, which is not valid UTF-8.

When allow_bytes is disabled (the default), an expression like (?-u:\xFF) will cause the parser to return an error, since it would otherwise match invalid UTF-8. When enabled, it will be allowed.

Set the nesting limit for regular expression parsing.

Regular expressions that nest more than this limit will result in a StackExhausted error.

Parse a string as a regular expression using the current configuraiton.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.