Always runs the NFA using bounded backtracking.
(
&self,
matches: &mut [bool],
slots: &mut [Slot],
text: &[u8],
start: usize,
end: usize,
)
| 1024 | |
| 1025 | /// Always runs the NFA using bounded backtracking. |
| 1026 | fn exec_backtrack( |
| 1027 | &self, |
| 1028 | matches: &mut [bool], |
| 1029 | slots: &mut [Slot], |
| 1030 | text: &[u8], |
| 1031 | start: usize, |
| 1032 | end: usize, |
| 1033 | ) -> bool { |
| 1034 | if self.ro.nfa.uses_bytes() { |
| 1035 | backtrack::Bounded::exec( |
| 1036 | &self.ro.nfa, |
| 1037 | self.cache, |
| 1038 | matches, |
| 1039 | slots, |
| 1040 | ByteInput::new(text, self.ro.nfa.only_utf8), |
| 1041 | start, |
| 1042 | end) |
| 1043 | } else { |
| 1044 | backtrack::Bounded::exec( |
| 1045 | &self.ro.nfa, |
| 1046 | self.cache, |
| 1047 | matches, |
| 1048 | slots, |
| 1049 | CharInput::new(text), |
| 1050 | start, |
| 1051 | end) |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | /// Finds which regular expressions match the given text. |
| 1056 | /// |