diff --git a/src/util/regex/regex-backref-matcher.hpp b/src/util/regex/regex-backref-matcher.hpp
index 1174541..77efd83 100644
--- a/src/util/regex/regex-backref-matcher.hpp
+++ b/src/util/regex/regex-backref-matcher.hpp
@@ -69,7 +69,7 @@
 RegexBackrefMatcher::compile()
 {
   if (m_expr.size() < 2)
-    throw RegexMatcher::Error("Unrecognized format: " + m_expr);
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("Unrecognized format: " + m_expr));
 
   size_t lastIndex = m_expr.size() - 1;
   if ('(' == m_expr[0] && ')' == m_expr[lastIndex]) {
@@ -80,7 +80,7 @@
     m_matchers.push_back(matcher);
   }
   else
-    throw RegexMatcher::Error("Unrecognized format: " + m_expr);
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("Unrecognized format: " + m_expr));
 }
 
 
diff --git a/src/util/regex/regex-component-matcher.hpp b/src/util/regex/regex-component-matcher.hpp
index 6b5474a..029bb03 100644
--- a/src/util/regex/regex-component-matcher.hpp
+++ b/src/util/regex/regex-component-matcher.hpp
@@ -136,7 +136,8 @@
     }
   else
     {
-      throw RegexMatcher::Error("Non-exact component search is not supported yet!");
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Non-exact component search is not supported "
+                                                "yet"));
     }
 
   return false;
diff --git a/src/util/regex/regex-component-set-matcher.hpp b/src/util/regex/regex-component-set-matcher.hpp
index 9c2ff16..b20ad44 100644
--- a/src/util/regex/regex-component-set-matcher.hpp
+++ b/src/util/regex/regex-component-set-matcher.hpp
@@ -92,7 +92,8 @@
 RegexComponentSetMatcher::compile()
 {
   if (m_expr.size() < 2)
-    throw RegexMatcher::Error("Regexp compile error (cannot parse " + m_expr + ")");
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("Regexp compile error (cannot parse " +
+                                              m_expr + ")"));
 
   switch (m_expr[0]) {
   case '<':
@@ -101,7 +102,8 @@
     {
       size_t lastIndex = m_expr.size() - 1;
       if (']' != m_expr[lastIndex])
-        throw RegexMatcher::Error("Regexp compile error (no matching ']' in " + m_expr + ")");
+        BOOST_THROW_EXCEPTION(RegexMatcher::Error("Regexp compile error (no matching ']' in " +
+                                                  m_expr + ")"));
 
       if ('^' == m_expr[1]) {
         m_isInclusion = false;
@@ -112,7 +114,8 @@
       break;
     }
   default:
-    throw RegexMatcher::Error("Regexp compile error (cannot parse " + m_expr + ")");
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("Regexp compile error (cannot parse " +
+                                              m_expr + ")"));
   }
 }
 
@@ -123,7 +126,7 @@
 
   if (m_expr.size() != end)
     {
-      throw RegexMatcher::Error("Component expr error " + m_expr);
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Component expr error " + m_expr));
     }
   else
     {
@@ -142,7 +145,7 @@
 
   while (index < lastIndex) {
     if ('<' != m_expr[index])
-      throw RegexMatcher::Error("Component expr error " + m_expr);
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Component expr error " + m_expr));
 
     tempIndex = index + 1;
     index = extractComponent(tempIndex);
@@ -155,7 +158,7 @@
   }
 
   if (index != lastIndex)
-    throw RegexMatcher::Error("Not sufficient expr to parse " + m_expr);
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("Not sufficient expr to parse " + m_expr));
 }
 
 inline bool
@@ -208,7 +211,7 @@
       break;
 
     case 0:
-      throw RegexMatcher::Error("Error: square brackets mismatch");
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Error: square brackets mismatch"));
       break;
     }
     index++;
diff --git a/src/util/regex/regex-pattern-list-matcher.hpp b/src/util/regex/regex-pattern-list-matcher.hpp
index acca0f9..fedcbaa 100644
--- a/src/util/regex/regex-pattern-list-matcher.hpp
+++ b/src/util/regex/regex-pattern-list-matcher.hpp
@@ -86,7 +86,7 @@
     subHead = index;
 
     if (!extractPattern(subHead, &index))
-      throw RegexMatcher::Error("Compile error");
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Compile error"));
   }
 }
 
@@ -135,7 +135,7 @@
     break;
 
   default:
-    throw RegexMatcher::Error("Unexpected syntax");
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("Unexpected syntax"));
   }
 
   *next = end;
@@ -152,7 +152,7 @@
   while (lcount > rcount) {
 
     if (index >= m_expr.size())
-      throw RegexMatcher::Error("Parenthesis mismatch");
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Parenthesis mismatch"));
 
     if (left == m_expr[index])
       lcount++;
@@ -184,7 +184,7 @@
         break;
     }
     if (index == exprSize)
-      throw RegexMatcher::Error("Missing right brace bracket");
+      BOOST_THROW_EXCEPTION(RegexMatcher::Error("Missing right brace bracket"));
     else
       return ++index;
   }
diff --git a/src/util/regex/regex-repeat-matcher.hpp b/src/util/regex/regex-repeat-matcher.hpp
index 3d6e4f5..530721e 100644
--- a/src/util/regex/regex-repeat-matcher.hpp
+++ b/src/util/regex/regex-repeat-matcher.hpp
@@ -162,12 +162,12 @@
         max = min;
       }
       else
-        throw RegexMatcher::Error(std::string("Error: RegexRepeatMatcher.ParseRepetition(): ")
-                                  + "Unrecognized format "+ m_expr);
+        BOOST_THROW_EXCEPTION(RegexMatcher::Error(std::string("Error: RegexRepeatMatcher.ParseRepetition():")
+                                                  + " Unrecognized format "+ m_expr));
 
       if (min > MAX_REPETITIONS || max > MAX_REPETITIONS || min > max)
-        throw RegexMatcher::Error(std::string("Error: RegexRepeatMatcher.ParseRepetition(): ")
-                                  + "Wrong number " + m_expr);
+        BOOST_THROW_EXCEPTION(RegexMatcher::Error(std::string("Error: RegexRepeatMatcher.ParseRepetition():")
+                                                  + " Wrong number " + m_expr));
 
       m_repeatMin = min;
       m_repeatMax = max;
diff --git a/src/util/regex/regex-top-matcher.cpp b/src/util/regex/regex-top-matcher.cpp
index 5ed4937..30b755f 100644
--- a/src/util/regex/regex-top-matcher.cpp
+++ b/src/util/regex/regex-top-matcher.cpp
@@ -146,7 +146,7 @@
                 result.append(*it);
             }
           else
-            throw RegexMatcher::Error("Exceed the range of back reference");
+            BOOST_THROW_EXCEPTION(RegexMatcher::Error("Exceed the range of back reference"));
         }
     }
   return result;
@@ -161,23 +161,23 @@
     {
       offset++;
       if (offset >= expand.size())
-        throw RegexMatcher::Error("wrong format of expand string!");
+        BOOST_THROW_EXCEPTION(RegexMatcher::Error("wrong format of expand string!"));
 
       while (expand[offset] <= '9' and expand[offset] >= '0') {
         offset++;
         if (offset > expand.size())
-          throw RegexMatcher::Error("wrong format of expand string!");
+          BOOST_THROW_EXCEPTION(RegexMatcher::Error("wrong format of expand string!"));
       }
       if (offset > begin + 1)
         return expand.substr(begin, offset - begin);
       else
-        throw RegexMatcher::Error("wrong format of expand string!");
+        BOOST_THROW_EXCEPTION(RegexMatcher::Error("wrong format of expand string!"));
     }
   else if (expand[offset] == '<')
     {
       offset++;
       if (offset >= expand.size())
-        throw RegexMatcher::Error("wrong format of expand string!");
+        BOOST_THROW_EXCEPTION(RegexMatcher::Error("wrong format of expand string!"));
 
       size_t left = 1;
       size_t right = 0;
@@ -189,12 +189,12 @@
             right++;
           offset++;
           if (offset >= expand.size())
-            throw RegexMatcher::Error("wrong format of expand string!");
+            BOOST_THROW_EXCEPTION(RegexMatcher::Error("wrong format of expand string!"));
         }
       return expand.substr(begin, offset - begin);
     }
   else
-    throw RegexMatcher::Error("wrong format of expand string!");
+    BOOST_THROW_EXCEPTION(RegexMatcher::Error("wrong format of expand string!"));
 }
 
 shared_ptr<RegexTopMatcher>
