fn captures_at(
        &self,
        slots: &mut [Slot],
        text: &[u8],
        start: usize,
    ) -> Option<(usize, usize)> {
        if !self.is_anchor_end_match(text) {
            return None;
        }
        match self.ro.match_type {
            MatchType::Literal(ty) => {
                self.exec_literals(ty, text, start).and_then(|(s, _)| {
                    self.captures_nfa(MatchNfaType::Auto, slots, text, s)
                })
            }
            MatchType::Dfa => {
                match self.find_dfa_forward(text, start) {
                    dfa::Result::Match((s, _)) => {
                        self.captures_nfa(
                            MatchNfaType::Auto, slots, text, s)
                    }
                    dfa::Result::NoMatch => None,
                    dfa::Result::Quit => {
                        self.captures_nfa(
                            MatchNfaType::Auto, slots, text, start)
                    }
                }
            }
            MatchType::Nfa(ty) => {
                self.captures_nfa(ty, slots, text, start)
            }
            MatchType::Nothing => None,
            MatchType::DfaMany => {
                unreachable!("BUG: RegexSet cannot be used with captures")
            }
        }
    }
/// Finds the start and end location of the leftmost-first match and also
/// fills in all matching capture groups.
///
/// The number of capture slots given should be equal to the total number
/// of capture slots in the compiled program.
///
/// Note that the first two slots always correspond to the start and end
/// locations of the overall match.
Finds the start and end location of the leftmost-first match and also
fills in all matching capture groups.

The number of capture slots given should be equal to the total number
of capture slots in the compiled program.

Note that the first two slots always correspond to the start and end
locations of the overall match.
Finds the start and end location of the leftmost - first match and also fills in all matching capture groups . The number of capture slots given should be equal to the total number of capture slots in the compiled program . Note that the first two slots always correspond to the start and end locations of the overall match .
fn captures_at(
        &self,
        slots: &mut [Slot],
        text: &[u8],
        start: usize,
    ) -> Option<(usize, usize)> {
        if !self.is_anchor_end_match(text) {
            return None;
        }
        match self.ro.match_type {
            MatchType::Literal(ty) => {
                self.exec_literals(ty, text, start).and_then(|(s, _)| {
                    self.captures_nfa(MatchNfaType::Auto, slots, text, s)
                })
            }
            MatchType::Dfa => {
                match self.find_dfa_forward(text, start) {
                    dfa::Result::Match((s, _)) => {
                        self.captures_nfa(
                            MatchNfaType::Auto, slots, text, s)
                    }
                    dfa::Result::NoMatch => None,
                    dfa::Result::Quit => {
                        self.captures_nfa(
                            MatchNfaType::Auto, slots, text, start)
                    }
                }
            }
            MatchType::Nfa(ty) => {
                self.captures_nfa(ty, slots, text, start)
            }
            MatchType::Nothing => None,
            MatchType::DfaMany => {
                unreachable!("BUG: RegexSet cannot be used with captures")
            }
        }
    }
fn captures_at ( & self , slots : & mut [ Slot ] , text : & [ u8 ] , start : usize , ) -> Option < ( usize , usize ) > { if ! self . is_anchor_end_match ( text ) { return None ; } match self . ro . match_type { MatchType :: Literal ( ty ) => { self . exec_literals ( ty , text , start ) . and_then ( | ( s , _ ) | { self . captures_nfa ( MatchNfaType :: Auto , slots , text , s ) } ) } MatchType :: Dfa => { match self . find_dfa_forward ( text , start ) { dfa :: Result :: Match ( ( s , _ ) ) => { self . captures_nfa ( MatchNfaType :: Auto , slots , text , s ) } dfa :: Result :: NoMatch => None , dfa :: Result :: Quit => { self . captures_nfa ( MatchNfaType :: Auto , slots , text , start ) } } } MatchType :: Nfa ( ty ) => { self . captures_nfa ( ty , slots , text , start ) } MatchType :: Nothing => None , MatchType :: DfaMany => { unreachable ! ( " " ) } } }
Finds the start and end location of the leftmost-first match and also
fills in all matching capture groups.
Finds the start and end location of the leftmost - first match and also fills in all matching capture groups .
&self
slots
&mut [Slot]
text
&[u8]
start
usize
&self
slots
&mut [Slot]
text
&[u8]
start
usize