From: bandoti Date: Wed, 11 Jun 2025 20:19:44 +0000 (-0300) Subject: common: fix issue with regex_escape routine on windows (#14133) X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=2e89f76b7af2c0b827be785e445f2e2b3e52e1ca;p=pkg%2Fggml%2Fsources%2Fllama.cpp common: fix issue with regex_escape routine on windows (#14133) --- diff --git a/common/common.cpp b/common/common.cpp index 218f1e1d..e23887c7 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -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 & values, const std::string & separator) {