diff --git a/src/support/regex.h b/src/support/regex.h index dd4875e35f..94140a53ea 100644 --- a/src/support/regex.h +++ b/src/support/regex.h @@ -17,7 +17,7 @@ # ifdef _MSC_VER namespace lyx { // inheriting 'private' to see which functions are used and if there are - // other ECMAScrip defaults + // other ECMAScript defaults // FIXME: Is this really needed? // If yes, then the MSVC regex implementation is not standard-conforming. class regex : private std::regex @@ -35,20 +35,20 @@ namespace lyx { }; template bool regex_match(T t, const regex& r) { return std::regex_match(t, r.toStd()); } + template + bool regex_match(T t, std::smatch& m, const regex& r) { return std::regex_match(t, m, r.toStd()); } template - bool regex_match(T t, V v, const regex& r) { return std::regex_match(t, v, r.toStd()); } - template - bool regex_match(T t, V v, H h, const regex& r, U u) { return std::regex_match(t, v, h, r.toStd(), u); } + bool regex_match(T t, V v, std::smatch& m, const regex& r) { return std::regex_match(t, v, m, r.toStd()); } template std::string regex_replace(T t, const regex& r, V v) { return std::regex_replace(t, r.toStd(), v); } - //template - //std::string regex_replace(T t, V v, U u, const regex& r, H h) { return std::regex_replace(t, v, u, r.toStd(), h); } + template + T regex_replace(T t, V v, U u, const regex& r, H h) { return std::regex_replace(t, v, u, r.toStd(), h); } template bool regex_search(T t, const regex& r) { return std::regex_search(t, r.toStd()); } + template + bool regex_search(T t, std::smatch& m, const regex& r) { return std::regex_search(t, m, r.toStd()); } template - bool regex_search(T t, V v, const regex& r) { return std::regex_search(t, v, r.toStd()); } - template - bool regex_search(T t, V v, U u, const regex& r) { return std::regex_search(t, v, u, r.toStd()); } + bool regex_search(T t, V v, std::smatch& m, const regex& r) { return std::regex_search(t, v, m, r.toStd()); } struct sregex_iterator : std::sregex_iterator { @@ -64,6 +64,8 @@ namespace lyx { namespace lyx { using LR_NS::regex; using LR_NS::regex_match; +using LR_NS::regex_replace; +using LR_NS::regex_search; using LR_NS::sregex_iterator; } # endif @@ -73,16 +75,16 @@ using LR_NS::sregex_iterator; namespace lyx { using LR_NS::regex; using LR_NS::regex_match; +using LR_NS::regex_replace; +using LR_NS::regex_search; using LR_NS::sregex_iterator; } #endif namespace lyx { using LR_NS::smatch; -using LR_NS::regex_replace; using LR_NS::basic_regex; using LR_NS::regex_error; -using LR_NS::regex_search; using LR_NS::match_results; namespace regex_constants