Skip to content

Commit d56ecd8

Browse files
committed
Fix regex_escape
1 parent 97340b4 commit d56ecd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ size_t string_find_partial_stop(const std::string_view & str, const std::string_
466466

467467
std::string regex_escape(const std::string & s) {
468468
static const std::regex special_chars("[.^$|()*+?\\[\\]{}\\\\]");
469-
return std::regex_replace(s, special_chars, "\\$0");
469+
return std::regex_replace(s, special_chars, "\\$&");
470470
}
471471

472472
std::string string_join(const std::vector<std::string> & values, const std::string & separator) {

0 commit comments

Comments
 (0)