Skip to main content

Module regex

Module regex 

Source
Expand description

Regex processing nodes.

Structs§

PatternMatch
Promoted pattern match: true if input matches pattern under the literal / glob / regex promotion rules. Sibling to regex_match (which takes a raw regex) — use this when the pattern may be a strict string, a * glob, or a regex and the kind should be auto-detected from its shape.
RegexExtract
Regex extract: extract the first capture group (or full match).
RegexMatch
Regex match: test if input matches a pattern.
RegexReplace
Regex replace: substitute all matches of a pattern with the replacement string. The compiled Regex is cached at construction.

Enums§

PatternDialect
Which dialect promote_pattern / compile_pattern picked.

Functions§

compile_pattern
Promote and compile source into an anchored Regex.
promote_pattern
Classify source and return its anchored regex source + dialect. Pure — does not compile. Promotion rules: