Index: /trunk/FACT++/src/rootifysql.cc
===================================================================
--- /trunk/FACT++/src/rootifysql.cc	(revision 19182)
+++ /trunk/FACT++/src/rootifysql.cc	(revision 19183)
@@ -1,7 +1,6 @@
 #include "Database.h"
 
-#include <regex>
-
 #include <boost/algorithm/string/join.hpp>
+#include <boost/regex.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/algorithm/string.hpp>
@@ -120,12 +119,12 @@
     vector<string> vec;
 
-    string substitute(string _str, const regex &expr)
-    {
-        smatch match;
-        while (regex_search(_str, match, expr, regex_constants::format_first_only))
-        {
-            const auto &len = match.length(0);
-            const auto &pos = match.position(0);
-            const auto &str = match.str(0);
+    string substitute(string _str, const boost::regex &expr)
+    {
+        boost::smatch match;
+        while (boost::regex_search(_str, match, expr, boost::regex_constants::format_first_only))
+        {
+            const auto &len = match.length();
+            const auto &pos = match.position();
+            const auto &str = match.str();
 
             const auto it = find(vec.cbegin(), vec.cend(), str);
@@ -143,5 +142,5 @@
     string substitute(const string &str, const string &expr)
     {
-        return substitute(str, regex(expr));
+        return substitute(str, boost::regex(expr));
     }
 
@@ -151,13 +150,12 @@
     {
         // search for "KEYWORD expression"
-        regex reg("\\{[0-9]+\\}");
-
-        //smatch match;
-        smatch match;
-        while (regex_search(str, match, reg, regex_constants::format_first_only))
-        {
-            const auto &len = match.length(0);
-            const auto &pos = match.position(0);
-            const auto &arg = match.str(0);      // Argument
+        boost::regex reg("\\{[0-9]+\\}");
+
+        boost::smatch match;
+        while (boost::regex_search(str, match, reg, boost::regex_constants::format_first_only))
+        {
+            const auto &len = match.length();
+            const auto &pos = match.position();
+            const auto &arg = match.str();      // Argument
 
             const auto idx = atoi(arg.c_str()+1);
@@ -220,8 +218,8 @@
 
         // Matche: (  _com  )?       (     (  _tok  )?   (  _exp  )      |      (  _tok  )     )
-        regex reg("("+_com+")?"  +  "(" + "("+_tok+")?"+"("+_exp+")"  + "|" +  "("+_tok+")" + ")");
-
-        smatch match;
-        while (regex_search(str, match, reg, regex_constants::format_first_only))
+        boost::regex reg("("+_com+")?"  +  "(" + "("+_tok+")?"+"("+_exp+")"  + "|" +  "("+_tok+")" + ")");
+
+        boost::smatch match;
+        while (boost::regex_search(str, match, reg, boost::regex_constants::format_first_only))
         {
 
@@ -258,5 +256,5 @@
             }
 
-            str = str.substr(match.position(0)+match.length(0));
+            str = str.substr(match.position()+match.length());
         }
     }
@@ -490,6 +488,6 @@
 
     vector<string> variables;
-    for (const auto &var : vars)
-        variables.emplace_back('@'+var.substr(4)+":="+Tools::Trim(conf.Get<string>(var)));
+    for (auto var=vars.cbegin(); var!=vars.cend(); var++)
+        variables.emplace_back('@'+var->substr(4)+":="+Tools::Trim(conf.Get<string>(*var)));
 
     // -------------------------------------------------------------------------
@@ -526,11 +524,13 @@
     map<string, vector<string>> envs;
 
-    for (const auto &env : conf.GetWildcardOptions("env.*"))
-        envs[env.substr(4)] = conf.Vec<string>(env);
-
-    for (const auto &env : conf.GetWildcardOptions("list.*"))
-    {
-        const string  fname = conf.Get<string>(env);
-        const string &ident = env.substr(5);
+    const auto &envs1 = conf.GetWildcardOptions("env.*");
+    for (auto env=envs1.cbegin(); env!=envs1.cend(); env++)
+        envs[env->substr(4)] = conf.Vec<string>(*env);
+
+    const auto &envs2 = conf.GetWildcardOptions("list.*");
+    for (auto env=envs2.cbegin(); env!=envs2.cend(); env++)
+    {
+        const string  fname = conf.Get<string>(*env);
+        const string &ident = env->substr(5);
 
         ifstream fin(fname);
@@ -540,5 +540,4 @@
             return 6;
         }
-
         for (string line; getline(fin, line); )
         {
@@ -552,8 +551,8 @@
     }
 
-    for (const auto &env : envs)
-    {
-        regex rexpr("\\$(\\{"+env.first+"\\}|"+env.first+"\\b)");
-        query = regex_replace(query, rexpr, boost::join(env.second, ", "));
+    for (auto env=envs.cbegin(); env!=envs.cend(); env++)
+    {
+        boost::regex rexpr("\\$(\\{"+env->first+"\\}|"+env->first+"\\b)");
+        query = boost::regex_replace(query, rexpr, boost::join(env->second, ", "));
     }
 
@@ -591,5 +590,5 @@
     // --------------------------- Connect to database -------------------------------------------------
 
-    if (query.back()!='\n')
+    if (*query.rbegin()!='\n')
         query += '\n';
 
@@ -815,7 +814,7 @@
 
         bool found = false;
-        for (const auto &pattern: _ignore)
-        {
-            if (regex_match(l[i], regex(pattern)))
+        for (auto pattern=_ignore.cbegin(); pattern!=_ignore.cend(); pattern++)
+        {
+            if (boost::regex_match(l[i], boost::regex(*pattern)))
             {
                 found = true;
