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
..
BUILD.bazel Remove workarounds for MSVC with versions _MSC_VER < 1925 2026-09-03 08:29:26 -07:00
gmock_all_test.cc Split gmock-matchers_test into 4 smaller test #3653 2022-03-23 09:08:04 -07:00
gmock_ex_test.cc Add missing std includes 2023-04-20 14:29:09 -07:00
gmock_leak_test_.cc Use '=default' to define trivial constructor/destructors 2023-04-21 10:41:25 -07:00
gmock_leak_test.py Fix formatting in subset of Python files 2023-01-25 09:14:26 -08:00
gmock_link2_test.cc Running clang-format over all of GoogleTest 2022-03-15 13:42:11 -07:00
gmock_link_test.cc Running clang-format over all of GoogleTest 2022-03-15 13:42:11 -07:00
gmock_link_test.h Automated Code Change 2026-07-24 23:56:31 -07:00
gmock_output_test_.cc Merge branch 'main' into fixes_std_pair_diff 2023-05-01 14:27:38 -04:00
gmock_output_test_golden.txt Remove "blindly" from the gmock "uninteresting call" message. 2025-06-05 14:31:20 -07:00
gmock_output_test.py Fix formatting in subset of Python files 2023-01-25 09:14:26 -08:00
gmock_stress_test.cc Automated Code Change 2026-07-27 21:17:32 -07:00
gmock_test_utils.py Remove pylint disable comments that no longer trigger warnings 2023-01-25 12:35:34 -08:00
gmock_test.cc Remove wchar_t overloads if GTEST_HAS_STD_WSTRING is disabled 2026-08-17 10:35:06 -07:00
gmock-actions_test.cc Remove workarounds for MSVC with versions _MSC_VER < 1915 2026-09-02 14:02:24 -07:00
gmock-cardinalities_test.cc Add [[nodiscard]] throughput Google Test. 2025-12-08 12:55:11 -08:00
gmock-function-mocker_test.cc Automated Code Change 2026-06-23 06:03:11 -07:00
gmock-internal-utils_test.cc Mark InternalDefaultActionSetAt as nodiscard. 2025-10-16 06:31:44 -07:00
gmock-matchers_test.h Automated Code Change 2026-06-23 06:03:11 -07:00
gmock-matchers-arithmetic_test.cc Add [[nodiscard]] throughput Google Test. 2025-12-08 12:55:11 -08:00
gmock-matchers-comparisons_test.cc Remove workarounds for MSVC with versions _MSC_VER < 1915 2026-09-02 14:02:24 -07:00
gmock-matchers-containers_test.cc UnorderedElementsAre(): Allow matching containers where end is a [sentinel](https://en.cppreference.com/cpp/iterator/sentinel_for). ElementsAre already supports that. 2026-08-27 04:14:10 -07:00
gmock-matchers-misc_test.cc Automated Code Change 2026-06-23 06:03:11 -07:00
gmock-more-actions_test.cc Set up inlining for InvokeWithoutArgs when passed a functor. 2026-07-17 10:58:22 -07:00
gmock-nice-strict_test.cc Use '=default' to define trivial constructor/destructors 2023-04-21 10:41:25 -07:00
gmock-port_test.cc Running clang-format over all of GoogleTest 2022-03-15 13:42:11 -07:00
gmock-pp_test.cc Double the MOCK_METHOD parameter count limit to mitigate users running into it 2026-05-15 11:11:10 -07:00
gmock-pp-string_test.cc Running clang-format over all of GoogleTest 2022-03-15 13:42:11 -07:00
gmock-spec-builders_test.cc 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