| 93 | } |
| 94 | |
| 95 | int FilteredRE2::FirstMatch(const StringPiece& text, |
| 96 | const std::vector<int>& atoms) const { |
| 97 | if (!compiled_) { |
| 98 | LOG(DFATAL) << "FirstMatch called before Compile."; |
| 99 | return -1; |
| 100 | } |
| 101 | std::vector<int> regexps; |
| 102 | prefilter_tree_->RegexpsGivenStrings(atoms, ®exps); |
| 103 | for (size_t i = 0; i < regexps.size(); i++) |
| 104 | if (RE2::PartialMatch(text, *re2_vec_[regexps[i]])) |
| 105 | return regexps[i]; |
| 106 | return -1; |
| 107 | } |
| 108 | |
| 109 | bool FilteredRE2::AllMatches( |
| 110 | const StringPiece& text, |