]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/tests/biblio.cpp
Revert "Amend 3093789e for cmake build"
[lyx.git] / src / frontends / tests / biblio.cpp
index 97ae4a9eb7ed0b1734ea67528da25096d592c748..9fa7c237df84a76ef3732119b950ff05c17d3d0e 100644 (file)
@@ -2,8 +2,7 @@
 
 #include <iostream>
 #include <map>
-
-#include "support/regex.h"
+#include <regex>
 
 using namespace std;
 
@@ -16,21 +15,13 @@ string const escape_special_chars(string const & expr)
 {
        // Search for all chars '.|*?+(){}[^$]\'
        // Note that '[', ']', and '\' must be escaped.
-       lyx::regex reg("[.|*?+(){}^$\\[\\]\\\\]");
+       regex reg("[.|*?+(){}^$\\[\\]\\\\]");
 
        // $& is a ECMAScript format expression that expands to all
        // of the current match
-#ifdef LYX_USE_STD_REGEX
        // To prefix a matched expression with a single literal backslash, we
        // need to escape it for the C++ compiler and use:
-       return lyx::regex_replace(expr, reg, "\\$&");
-#else
-       // A backslash in the format string starts an escape sequence in boost.
-       // Thus, to prefix a matched expression with a single literal backslash,
-       // we need to give two backslashes to the regex engine, and escape both
-       // for the C++ compiler and use:
-       return lyx::regex_replace(expr, reg, "\\\\$&");
-#endif
+       return regex_replace(expr, reg, "\\$&");
 }
 
 
@@ -57,11 +48,11 @@ public:
 
                // Attempts to find a match for the current RE
                // somewhere in data.
-               return lyx::regex_search(data, regex_);
+               return regex_search(data, regex_);
        }
 private:
        InfoMap const map_;
-       mutable lyx::regex regex_;
+       mutable regex regex_;
 };
 
 
@@ -85,7 +76,7 @@ void test_RegexMatch()
                cout << rm("hello") << endl;
                cout << rm("hei") << endl;
        }
-       catch (lyx::regex_error & regerr) {
+       catch (regex_error & regerr) {
                cout << regerr.what() << endl;
        }
 }