X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiCitation.cpp;h=a263ddf2cf940e5906c64832851352386a1a51f6;hb=7779316e6c5dd6d0d522d8fdfedf5cba48c56c6a;hp=7a402ed9752e26a823fbe745bae276e4ff137591;hpb=54ccd275f1c115da5ea279652421b018564f5c56;p=features.git diff --git a/src/frontends/qt/GuiCitation.cpp b/src/frontends/qt/GuiCitation.cpp index 7a402ed975..a263ddf2cf 100644 --- a/src/frontends/qt/GuiCitation.cpp +++ b/src/frontends/qt/GuiCitation.cpp @@ -45,9 +45,8 @@ #undef KeyPress -#include "support/regex.h" - #include +#include #include #include @@ -987,21 +986,21 @@ static docstring escape_special_chars(docstring const & expr) { // Search for all chars '.|*?+(){}[^$]\' // Note that '[', ']', and '\' must be escaped. - static const lyx::regex reg("[.|*?+(){}^$\\[\\]\\\\]"); + static const regex reg("[.|*?+(){}^$\\[\\]\\\\]"); // $& is an ECMAScript format expression that expands to all // of the current match // To prefix a matched expression with a single literal backslash, we // need to escape it for the C++ compiler and use: // FIXME: UNICODE - return from_utf8(lyx::regex_replace(to_utf8(expr), reg, string("\\$&"))); + return from_utf8(regex_replace(to_utf8(expr), reg, string("\\$&"))); } vector GuiCitation::searchKeys(BiblioInfo const & bi, vector const & keys_to_search, bool only_keys, docstring const & search_expression, docstring const & field, - bool case_sensitive, bool regex) + bool case_sensitive, bool re) { vector foundKeys; @@ -1009,17 +1008,17 @@ vector GuiCitation::searchKeys(BiblioInfo const & bi, if (expr.empty()) return foundKeys; - if (!regex) + if (!re) // We must escape special chars in the search_expr so that - // it is treated as a simple string by lyx::regex. + // it is treated as a simple string by regex. expr = escape_special_chars(expr); - lyx::regex reg_exp; + regex reg_exp; try { reg_exp.assign(to_utf8(expr), case_sensitive ? - lyx::regex_constants::ECMAScript : lyx::regex_constants::icase); - } catch (lyx::regex_error const & e) { - // lyx::regex throws an exception if the regular expression is not + regex_constants::ECMAScript : regex_constants::icase); + } catch (regex_error const & e) { + // regex throws an exception if the regular expression is not // valid. LYXERR(Debug::GUI, e.what()); return vector(); @@ -1045,10 +1044,10 @@ vector GuiCitation::searchKeys(BiblioInfo const & bi, continue; try { - if (lyx::regex_search(sdata, reg_exp)) + if (regex_search(sdata, reg_exp)) foundKeys.push_back(*it); } - catch (lyx::regex_error const & e) { + catch (regex_error const & e) { LYXERR(Debug::GUI, e.what()); return vector(); }