Struct onig::Captures [] [src]

pub struct Captures<'t> { /* fields omitted */ }

Captures represents a group of captured strings for a single match.

The 0th capture always corresponds to the entire match. Each subsequent index corresponds to the next capture group in the regex. Positions returned from a capture group are always byte indices.

't is the lifetime of the matched text.

Methods

impl<'t> Captures<'t>
[src]

[src]

Returns the start and end positions of the Nth capture group. Returns None if i is not a valid capture group or if the capture group did not match anything. The positions returned are always byte indices with respect to the original string matched.

[src]

Returns the matched string for the capture group i. If i isn't a valid capture group or didn't match anything, then None is returned.

[src]

Returns the number of captured groups.

[src]

Returns true if and only if there are no captured groups.

Important traits for SubCaptures<'t>
[src]

Creates an iterator of all the capture groups in order of appearance in the regular expression.

Important traits for SubCapturesPos<'t>
[src]

Creates an iterator of all the capture group positions in order of appearance in the regular expression. Positions are byte indices in terms of the original string matched.

[src]

Offset of the captures within the given string slice.

Trait Implementations

impl<'t> Debug for Captures<'t>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'t> !Send for Captures<'t>

impl<'t> !Sync for Captures<'t>