]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common: fix issue with regex_escape routine on windows (#14133)
authorbandoti <redacted>
Wed, 11 Jun 2025 20:19:44 +0000 (17:19 -0300)
committerGitHub <redacted>
Wed, 11 Jun 2025 20:19:44 +0000 (17:19 -0300)
common/common.cpp

index 218f1e1dc0e4d53a800aeb0ddf578ce129e2f6a9..e23887c70770c4d2e2de6ff1243f427b8592a777 100644 (file)
@@ -466,7 +466,7 @@ size_t string_find_partial_stop(const std::string_view & str, const std::string_
 
 std::string regex_escape(const std::string & s) {
     static const std::regex special_chars("[.^$|()*+?\\[\\]{}\\\\]");
-    return std::regex_replace(s, special_chars, "\\$0");
+    return std::regex_replace(s, special_chars, "\\$&");
 }
 
 std::string string_join(const std::vector<std::string> & values, const std::string & separator) {