| 912 | } |
| 913 | |
| 914 | void SearchPCRE(benchmark::State& state, const char* regexp, |
| 915 | const StringPiece& text, Prog::Anchor anchor, |
| 916 | bool expect_match) { |
| 917 | for (auto _ : state) { |
| 918 | PCRE re(regexp, PCRE::UTF8); |
| 919 | CHECK_EQ(re.error(), ""); |
| 920 | if (anchor == Prog::kAnchored) |
| 921 | CHECK_EQ(PCRE::FullMatch(text, re), expect_match); |
| 922 | else |
| 923 | CHECK_EQ(PCRE::PartialMatch(text, re), expect_match); |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | void SearchRE2(benchmark::State& state, const char* regexp, |
| 928 | const StringPiece& text, Prog::Anchor anchor, |