Lines Matching refs:start
396 fn shortest_match_at(&self, text: &str, start: usize) -> Option<usize> {
397 self.0.shortest_match_at(text.as_bytes(), start)
401 fn is_match_at(&self, text: &str, start: usize) -> bool {
402 self.0.is_match_at(text.as_bytes(), start)
406 fn find_at(&self, text: &str, start: usize) -> Option<(usize, usize)> {
407 self.0.find_at(text.as_bytes(), start)
415 start: usize,
417 self.0.captures_read_at(locs, text.as_bytes(), start)
426 /// start and end locations of the capture.)
438 fn shortest_match_at(&self, text: &[u8], start: usize) -> Option<usize> {
445 self.find_literals(ty, text, start).map(|(_, e)| e)
449 match self.shortest_dfa(text, start) {
452 dfa::Result::Quit => self.shortest_nfa(text, start),
461 &text[start..],
466 dfa::Result::Quit => self.shortest_nfa(text, start),
471 match self.shortest_dfa_reverse_suffix(text, start) {
474 dfa::Result::Quit => self.shortest_nfa(text, start),
477 MatchType::Nfa(ty) => self.shortest_nfa_type(ty, text, start),
487 fn is_match_at(&self, text: &[u8], start: usize) -> bool {
497 self.find_literals(ty, text, start).is_some()
501 match self.shortest_dfa(text, start) {
504 dfa::Result::Quit => self.match_nfa(text, start),
513 &text[start..],
518 dfa::Result::Quit => self.match_nfa(text, start),
523 match self.shortest_dfa_reverse_suffix(text, start) {
526 dfa::Result::Quit => self.match_nfa(text, start),
529 MatchType::Nfa(ty) => self.match_nfa_type(ty, text, start),
534 /// Finds the start and end location of the leftmost-first match, starting
537 fn find_at(&self, text: &[u8], start: usize) -> Option<(usize, usize)> {
543 MatchType::Literal(ty) => self.find_literals(ty, text, start),
545 MatchType::Dfa => match self.find_dfa_forward(text, start) {
549 self.find_nfa(MatchNfaType::Auto, text, start)
554 match self.find_dfa_anchored_reverse(text, start) {
558 self.find_nfa(MatchNfaType::Auto, text, start)
564 match self.find_dfa_reverse_suffix(text, start) {
568 self.find_nfa(MatchNfaType::Auto, text, start)
572 MatchType::Nfa(ty) => self.find_nfa(ty, text, start),
581 /// Finds the start and end location of the leftmost-first match and also
587 /// Note that the first two slots always correspond to the start and end
593 start: usize,
602 0 => return self.find_at(text, start),
604 return self.find_at(text, start).map(|(s, e)| {
618 self.find_literals(ty, text, start).and_then(|(s, e)| {
631 self.captures_nfa(slots, text, start)
633 match self.find_dfa_forward(text, start) {
643 self.captures_nfa(slots, text, start)
650 match self.find_dfa_anchored_reverse(text, start) {
659 dfa::Result::Quit => self.captures_nfa(slots, text, start),
664 match self.find_dfa_reverse_suffix(text, start) {
673 dfa::Result::Quit => self.captures_nfa(slots, text, start),
677 self.captures_nfa_type(ty, slots, text, start, text.len())
696 start: usize,
702 lits.find(&text[start..]).map(|(s, e)| (start + s, start + e))
706 if start == 0 || !self.ro.nfa.is_anchored_start {
707 lits.find_start(&text[start..])
708 .map(|(s, e)| (start + s, start + e))
715 lits.find_end(&text[start..])
716 .map(|(s, e)| (start + s, start + e))
723 .find(&text[start..])
724 .map(|m| (start + m.start(), start + m.end())),
728 /// Finds the leftmost-first match (start and end) using only the DFA.
737 start: usize,
745 start,
749 Match(end) if start == end => return Match((start, start)),
752 // Now run the DFA in reverse to find the start of the match.
757 &text[start..],
758 end - start,
760 Match(s) => Match((start + s, end)),
766 /// Finds the leftmost-first match (start and end) using only the DFA,
777 start: usize,
784 &text[start..],
785 text.len() - start,
787 Match(s) => Match((start + s, text.len())),
796 fn shortest_dfa(&self, text: &[u8], start: usize) -> dfa::Result<usize> {
797 dfa::Fsm::forward(&self.ro.dfa, self.cache.value(), true, text, start)
807 start: usize,
809 match self.exec_dfa_reverse_suffix(text, start) {
810 None => self.shortest_dfa(text, start),
816 /// suffix literals. It also reports the start of the match.
839 let mut start = original_start;
840 let mut end = start;
841 let mut last_literal = start;
852 &text[start..end],
853 end - start,
856 Match(i) => return Some(Match((start + i, end))),
858 start += i;
868 /// Finds the leftmost-first match (start and end) using only the DFA
878 start: usize,
882 let match_start = match self.exec_dfa_reverse_suffix(text, start) {
883 None => return self.find_dfa_forward(text, start),
884 Some(Match((start, _))) => start,
913 fn match_nfa(&self, text: &[u8], start: usize) -> bool {
914 self.match_nfa_type(MatchNfaType::Auto, text, start)
922 start: usize,
931 start,
938 fn shortest_nfa(&self, text: &[u8], start: usize) -> Option<usize> {
939 self.shortest_nfa_type(MatchNfaType::Auto, text, start)
947 start: usize,
957 start,
971 start: usize,
981 start,
1001 start: usize,
1007 start,
1018 start: usize,
1028 start,
1048 start: usize,
1068 start,
1072 self.exec_backtrack(matches, slots, text, start, end)
1083 start: usize,
1094 start,
1105 start,
1117 start: usize,
1127 start,
1137 start,
1154 start: usize,
1164 matches[0] = self.find_literals(ty, text, start).is_some();
1174 start,
1185 start,
1197 start,
1208 start,
1220 start,
1410 // If the regex is anchored at the end but not the start, then
1490 /// Match literals only at the start of text.