diff --git a/src/unicode.cpp b/src/unicode.cpp index 706e45b217..e65e05d95a 100644 --- a/src/unicode.cpp +++ b/src/unicode.cpp @@ -499,11 +499,9 @@ static std::vector unicode_regex_split_custom_llama3(const std::string & template static std::vector unicode_regex_split_stl(const std::basic_string & text, const std::basic_string & regex, const std::vector & offsets) { -#ifdef _MSC_VER // https://github.com/ggml-org/llama.cpp/issues/17830 - // MSVC's std::regex has stack limitations with complex patterns +#ifdef _MSC_VER // Bypass bug in MSVC: https://github.com/ggml-org/llama.cpp/issues/17830 constexpr auto regex_flags = std::regex_constants::ECMAScript; #else - // Prevents catastrophic backtracking on repetitive input constexpr auto regex_flags = std::regex_constants::optimize | std::regex_constants::nosubs; #endif std::basic_regex expr(regex, regex_flags);