| 925 | } |
| 926 | |
| 927 | void SearchRE2(benchmark::State& state, const char* regexp, |
| 928 | const StringPiece& text, Prog::Anchor anchor, |
| 929 | bool expect_match) { |
| 930 | for (auto _ : state) { |
| 931 | RE2 re(regexp); |
| 932 | CHECK_EQ(re.error(), ""); |
| 933 | if (anchor == Prog::kAnchored) |
| 934 | CHECK_EQ(RE2::FullMatch(text, re), expect_match); |
| 935 | else |
| 936 | CHECK_EQ(RE2::PartialMatch(text, re), expect_match); |
| 937 | } |
| 938 | } |
| 939 | |
| 940 | // SearchCachedXXX is like SearchXXX but only does the |
| 941 | // regexp parsing and compiling once. This lets us measure |