diff --git a/aegisub/src/command/edit.cpp b/aegisub/src/command/edit.cpp index 8bbe7e0de..fe1b5d8b4 100644 --- a/aegisub/src/command/edit.cpp +++ b/aegisub/src/command/edit.cpp @@ -863,8 +863,8 @@ std::string trim_text(std::string text) { boost::regex start("^( |\t|\\\\[nNh])+"); boost::regex end("( |\t|\\\\[nNh])+$"); - regex_replace(text, start, "", boost::format_first_only); - regex_replace(text, end, "", boost::format_first_only); + text = regex_replace(text, start, "", boost::format_first_only); + text = regex_replace(text, end, "", boost::format_first_only); return text; }