[libcxx-commits] [libcxx] [libc++] Fix `regex_search` to match `$` alone with `match_default` flag (PR #77256)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 8 08:54:39 PST 2024


================
@@ -47,5 +47,12 @@ int main(int, char**)
     assert( std::regex_search(target, re, std::regex_constants::match_not_eol));
     }
 
+    {
+      std::string target = "foo";
+      std::regex re("$");
+      assert(std::regex_search(target, re));
+      assert(!std::regex_search(target, re, std::regex_constants::match_not_eol));
----------------
mordante wrote:

Can you add a `regex_match` test too?

https://github.com/llvm/llvm-project/pull/77256


More information about the libcxx-commits mailing list