method Captures.named
The group called name ((?<name>…)).
Example:
fn main() io {
let c = Regex.compile("(?<key>[a-z]+)=(?<val>[0-9]+)")!.captures("rate=42")!
print("{c.named("key")!.text} {c.named("val")!.text} {c.named("nope")}")
}Output
rate 42 none
pub(api) fn named(name: str) -> Match?Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
name | str |
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:1201