regex
Compiled regular expression matching using RE2-compatible syntax.
Usage
Syntax
Patterns use RE2 syntax, the same as the Rust
regex crate. This supports
most common regular expression features including:
- Character classes:
\d,\w,\s,[a-z],[^abc] - Repetition:
*,+,?,{n},{n,m} - Anchors:
^,$,\b - Groups:
(abc),(?:abc)(non-capturing),(?<name>abc)(named) - Alternation:
a|b
Backreferences and lookahead/lookbehind assertions are not supported.
Types
| Type | Description |
|---|---|
Captures |
A successful match along with any capture groups. |
Match |
A single matched span within a string. |
Regex |
A compiled regular expression. |