Abseil Team dd0a37b843 Use std::regex (defining GTEST_USES_STD_RE) instead of hand-rolled regex engine (defining GTEST_USES_SIMPLE_RE) in GoogleTest
Previously, non-Abseil builds of GoogleTest used either the POSIX <regex.h> header, or a hand-rolled bare-bones regex engine in GoogleTest.

This commit removes the custom regex engine and switches to the C++11 <regex> header instead, which primarily affects Windows builds. Correspondingly, the GTEST_USES_SIMPLE_RE macro is removed and GTEST_USES_STD_RE is defined in its place, so users that depend on the macro should update their code accordingly.

This commit may break on any exotic toolchains or platforms that lack all of these libraries, but these have been long unsupported, as GoogleTest requires C++17.

Note: MSVC's engine can be prone to overflowing the stack on some patterns and inputs. As a trivial example:

    #include <regex>

    int main() {
      std::string corpus;
      for (size_t i = 0; i < 1000; ++i) {
         corpus += "a\n";
      }
      // Stack overflow
      std::regex_match(corpus, std::regex("(\n|.)*", std::regex_constants::ECMAScript));
    }

In such cases, it is recommended to use alternative patterns accomplishing the same goal, such as checking for pieces of a pattern independently.

PiperOrigin-RevId: 978659894
Change-Id: I4594285e696af12a008e1e4cee300f292bbdbf32
2026-09-09 11:34:13 -07:00
..
_data Googletest export 2021-06-02 17:55:09 -04:00
_layouts Updates Google Analytics tracker. 2025-05-22 12:37:05 -07:00
_sass Googletest export 2021-05-25 13:34:39 -04:00
assets/css Googletest export 2021-02-19 13:55:48 -05:00
reference Add documentation for two-argument floating point matchers. 2026-03-10 11:25:48 -07:00
_config.yml Googletest export 2021-02-19 13:55:48 -05:00
advanced.md Use std::regex (defining GTEST_USES_STD_RE) instead of hand-rolled regex engine (defining GTEST_USES_SIMPLE_RE) in GoogleTest 2026-09-09 11:34:13 -07:00
community_created_documentation.md Googletest export 2021-01-15 15:54:03 -05:00
faq.md Remove obsolete references to LinuxThreads. 2025-03-26 12:20:16 -07:00
gmock_cheat_sheet.md Fix typo in docs/gmock_cheat_sheet.md 2026-07-24 10:01:33 -07:00
gmock_cook_book.md Flip the recommendation about using EXPECT statements inside custom matchers. 2026-06-02 18:03:04 -07:00
gmock_faq.md Fix reference to source file in gmock FAQ 2022-01-14 14:40:35 -08:00
gmock_for_dummies.md Add anchor for expectation ordering note 2024-02-13 13:55:04 -08:00
index.md Googletest export 2021-02-26 17:58:04 -05:00
pkgconfig.md cmake: Raise min to 3.6 2023-06-19 11:21:44 -06:00
platforms.md Copy supported platforms from README onto https://google.github.io/googletest/platforms.html 2023-06-01 07:28:42 -07:00
primer.md Update the links to ISTQB glossary. 2024-12-11 08:00:11 -08:00
quickstart-bazel.md Update version strings to 1.18 2026-08-11 06:59:21 -07:00
quickstart-cmake.md Update documentation for v1.17.0 2025-04-30 10:11:59 -07:00
samples.md Merge pull request #3918 from assafpr:master2main 2022-08-01 11:47:51 -07:00