ExtractKind in regex_syntax::hir::literal - Rust (original) (raw)


#[non_exhaustive]

pub enum ExtractKind {
    Prefix,
    Suffix,
}

Expand description

The kind of literals to extract from an Hir expression.

The default extraction kind is Prefix.

This enum is marked as non-exhaustive

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

§

Extracts only prefix literals from a regex.

§

Extracts only suffix literals from a regex.

Note that the sequence returned by suffix literals currently may not correctly represent leftmost-first or “preference” order match semantics.

Source

Returns true if this kind is the Prefix variant.

Source

Returns true if this kind is the Suffix variant.