diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index 6cfcfb087..570a058b4 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -667,7 +667,7 @@ namespace Automation4 { // Strip the location from the error message since it's redundant with // the stack trace - boost::regex location("^\\[string \".*\"\\]:[0-9]+: "); + boost::regex location(R"(^\[string ".*"\]:[0-9]+: )"); message = regex_replace(message, location, "", boost::format_first_only); std::vector frames; diff --git a/aegisub/src/command/edit.cpp b/aegisub/src/command/edit.cpp index 08dc12b40..204a672d6 100644 --- a/aegisub/src/command/edit.cpp +++ b/aegisub/src/command/edit.cpp @@ -875,8 +875,8 @@ struct edit_line_paste_over : public Command { namespace { std::string trim_text(std::string text) { - boost::regex start("^( |\t|\\\\[nNh])+"); - boost::regex end("( |\t|\\\\[nNh])+$"); + boost::regex start(R"(^( | |\\[nNh])+)"); + boost::regex end(R"(( | |\\[nNh])+$)"); text = regex_replace(text, start, "", boost::format_first_only); text = regex_replace(text, end, "", boost::format_first_only); diff --git a/aegisub/src/subtitle_format_microdvd.cpp b/aegisub/src/subtitle_format_microdvd.cpp index a5468fb67..916b7d4c2 100644 --- a/aegisub/src/subtitle_format_microdvd.cpp +++ b/aegisub/src/subtitle_format_microdvd.cpp @@ -67,7 +67,7 @@ std::vector MicroDVDSubtitleFormat::GetWriteWildcards() const { return GetReadWildcards(); } -static const boost::regex line_regex("^[\\{\\[]([0-9]+)[\\}\\]][\\{\\[]([0-9]+)[\\}\\]](.*)$"); +static const boost::regex line_regex(R"(^[\{\[]([0-9]+)[\}\]][\{\[]([0-9]+)[\}\]](.*)$)"); bool MicroDVDSubtitleFormat::CanReadFile(agi::fs::path const& filename, std::string const& encoding) const { // Return false immediately if extension is wrong diff --git a/aegisub/src/subtitle_format_srt.cpp b/aegisub/src/subtitle_format_srt.cpp index 768903b22..c1a3206ef 100644 --- a/aegisub/src/subtitle_format_srt.cpp +++ b/aegisub/src/subtitle_format_srt.cpp @@ -86,8 +86,8 @@ class SrtTagParser { public: SrtTagParser() : tag_matcher("^(.*?)<(/?b|/?i|/?u|/?s|/?font)([^>]*)>(.*)$", boost::regex::icase) - , attrib_matcher("^[[:space:]]+(face|size|color)=('[^']*'|\"[^\"]*\"|[^[:space:]]+)", boost::regex::icase) - , is_quoted("^(['\"]).*\\1$") + , attrib_matcher(R"(^[[:space:]]+(face|size|color)=('[^']*'|"[^"]*"|[^[:space:]]+))", boost::regex::icase) + , is_quoted(R"(^(['"]).*\1$)") { tag_name_cases["b"] = TAG_BOLD_OPEN; tag_name_cases["/b"] = TAG_BOLD_CLOSE;