Like find, but executes an NFA engine.
(
&self,
ty: MatchNfaType,
text: &[u8],
start: usize,
)
| 905 | |
| 906 | /// Like find, but executes an NFA engine. |
| 907 | fn find_nfa( |
| 908 | &self, |
| 909 | ty: MatchNfaType, |
| 910 | text: &[u8], |
| 911 | start: usize, |
| 912 | ) -> Option<(usize, usize)> { |
| 913 | let mut slots = [None, None]; |
| 914 | if self.exec_nfa( |
| 915 | ty, |
| 916 | &mut [false], |
| 917 | &mut slots, |
| 918 | false, |
| 919 | text, |
| 920 | start, |
| 921 | text.len() |
| 922 | ) { |
| 923 | match (slots[0], slots[1]) { |
| 924 | (Some(s), Some(e)) => Some((s, e)), |
| 925 | _ => None, |
| 926 | } |
| 927 | } else { |
| 928 | None |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | /// Like find_nfa, but fills in captures. |
| 933 | /// |