diff --git a/src/cmake.cc b/src/cmake.cc index 225fce9..973ac6a 100644 --- a/src/cmake.cc +++ b/src/cmake.cc @@ -9,7 +9,7 @@ CMake::CMake(const boost::filesystem::path &path) { const auto find_cmake_project=[](const boost::filesystem::path &cmake_path) { for(auto &line: filesystem::read_lines(cmake_path)) { - const static std::regex project_regex("^ *project *\\(.*\\r?$", std::regex::icase); + const static std::regex project_regex(R"(^ *project *\(.*\r?$)", std::regex::icase); std::smatch sm; if(std::regex_match(line, sm, project_regex)) return true; diff --git a/src/compile_commands.cc b/src/compile_commands.cc index 5f11afe..27f946b 100644 --- a/src/compile_commands.cc +++ b/src/compile_commands.cc @@ -112,7 +112,7 @@ std::vector CompileCommands::get_arguments(const boost::filesystem: arguments.emplace_back(default_std_argument); auto clang_version_string=clangmm::to_string(clang_getClangVersion()); - const static std::regex clang_version_regex("^[A-Za-z ]+([0-9.]+).*$"); + const static std::regex clang_version_regex(R"(^[A-Za-z ]+([0-9.]+).*$)"); std::smatch sm; if(std::regex_match(clang_version_string, sm, clang_version_regex)) { auto clang_version=sm[1].str(); diff --git a/src/ctags.cc b/src/ctags.cc index 31a0845..d2f8f88 100644 --- a/src/ctags.cc +++ b/src/ctags.cc @@ -48,7 +48,7 @@ Ctags::Location Ctags::get_location(const std::string &line, bool markup) { auto &line_fixed=line; #endif - const static std::regex regex("^([^\t]+)\t([^\t]+)\t(?:/\\^)?([ \t]*)(.+?)(\\$/)?;\"\tline:([0-9]+)\t?[a-zA-Z]*:?(.*)$"); + const static std::regex regex(R"(^([^\t]+)\t([^\t]+)\t(?:/\^)?([ \t]*)(.+?)(\$/)?;"\tline:([0-9]+)\t?[a-zA-Z]*:?(.*)$)"); std::smatch sm; if(std::regex_match(line_fixed, sm, regex)) { location.symbol=sm[1].str(); diff --git a/src/meson.cc b/src/meson.cc index 0960c92..42516f6 100644 --- a/src/meson.cc +++ b/src/meson.cc @@ -9,7 +9,7 @@ Meson::Meson(const boost::filesystem::path &path) { const auto find_project=[](const boost::filesystem::path &file_path) { for(auto &line: filesystem::read_lines(file_path)) { - const static std::regex project_regex("^ *project *\\(.*\\r?$", std::regex::icase); + const static std::regex project_regex(R"(^ *project *\(.*\r?$)", std::regex::icase); std::smatch sm; if(std::regex_match(line, sm, project_regex)) return true; diff --git a/src/source_clang.cc b/src/source_clang.cc index f8146a7..d7bad23 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -536,8 +536,8 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa std::string line=" "+get_line_before(); const static std::regex dot_or_arrow(R"(^.*[a-zA-Z0-9_\)\]\>](\.|->)([a-zA-Z0-9_]*)$)"); - const static std::regex colon_colon("^.*::([a-zA-Z0-9_]*)$"); - const static std::regex part_of_symbol("^.*[^a-zA-Z0-9_]+([a-zA-Z0-9_]{3,})$"); + const static std::regex colon_colon(R"(^.*::([a-zA-Z0-9_]*)$)"); + const static std::regex part_of_symbol(R"(^.*[^a-zA-Z0-9_]+([a-zA-Z0-9_]{3,})$)"); std::smatch sm; if(std::regex_match(line, sm, dot_or_arrow)) { { @@ -987,7 +987,7 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file } else { // If cursor is at an include line, return offset to included file - const static std::regex include_regex("^[ \t]*#[ \t]*include[ \t]*[<\"]([^<>\"]+)[>\"].*$"); + const static std::regex include_regex(R"(^[ \t]*#[ \t]*include[ \t]*[<"]([^<>"]+)[>"].*$)"); std::smatch sm; auto line=get_line(); if(std::regex_match(line, sm, include_regex)) { diff --git a/src/source_language_protocol.cc b/src/source_language_protocol.cc index 2cbfccc..50906ba 100644 --- a/src/source_language_protocol.cc +++ b/src/source_language_protocol.cc @@ -1148,8 +1148,8 @@ void Source::LanguageProtocolView::setup_autocomplete() { std::string line=" "+get_line_before(); const static std::regex dot_or_arrow(R"(^.*[a-zA-Z0-9_\)\]\>"'](\.)([a-zA-Z0-9_]*)$)"); - const static std::regex colon_colon("^.*::([a-zA-Z0-9_]*)$"); - const static std::regex part_of_symbol("^.*[^a-zA-Z0-9_]+([a-zA-Z0-9_]{3,})$"); + const static std::regex colon_colon(R"(^.*::([a-zA-Z0-9_]*)$)"); + const static std::regex part_of_symbol(R"(^.*[^a-zA-Z0-9_]+([a-zA-Z0-9_]{3,})$)"); std::smatch sm; if(std::regex_match(line, sm, dot_or_arrow)) { { diff --git a/src/usages_clang.cc b/src/usages_clang.cc index ccd54cf..fd50f37 100644 --- a/src/usages_clang.cc +++ b/src/usages_clang.cc @@ -572,7 +572,7 @@ std::pair, Usages::Cla std::map paths_includes; PathSet paths_with_spelling; - const static std::regex include_regex("^[ \t]*#[ \t]*include[ \t]*[\"]([^\"]+)[\"].*$"); + const static std::regex include_regex(R"R(^[ \t]*#[ \t]*include[ \t]*"([^"]+)".*$)R"); auto is_spelling_char = [](char chr) { return (chr >= 'a' && chr <= 'z') || (chr >= 'A' && chr <= 'Z') || (chr >= '0' && chr <= '9') || chr == '_';