data Captures
A match with its capture groups; group 0 is the whole match, groups[i] is none when group i did not take part.
Example:
fn main() io {
let re = Regex.compile("([a-z]+)@([a-z.]+)")!
let c = re.captures("write to ann@example.org")!
print("{c.groups.len()} {c.text(1)!} {c.text(2)!}")
}Output
3 ann example.org
pub(api) data CapturesSince. 1.0.0-beta
Fields
Methods
whole | () -> MatchThe whole match. |
get | (i: usize) -> Match?Group i (0 = whole match). |
text | (i: usize) -> str?Text of group i. |
named | (name: str) -> Match?The group called name ((?<name>…)). |
Defined in: std/core/text.oxl:1138