]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/regex.cpp
Add move semantics to Variant
[libs/core.git] / source / strings / regex.cpp
index c62405614525dd85b32a73361bd78133e03ef29f..5307c6990286ba373291281fb4ee230ff81d2d07 100644 (file)
@@ -2,6 +2,7 @@
 #include <list>
 #include <stack>
 #include <vector>
+#include <msp/core/except.h>
 #include "format.h"
 #include "regex.h"
 
@@ -56,7 +57,6 @@ string bad_regex::make_where(const string &e, const string::const_iterator &i)
 
 Regex::Regex(const string &expr)
 {
-       n_groups = 0;
        auto iter = expr.begin();
        code = compile(expr, iter, n_groups, false);
        ++n_groups;
@@ -478,7 +478,7 @@ bool Regex::run(const string &str, const string::const_iterator &begin, vector<R
                                                input_consumed = true;
                                        }
                                        else
-                                               throw logic_error("invalid instruction in regex bytecode");
+                                               throw internal_error("invalid instruction in regex bytecode");
 
                                        if(match_result==negate_match)
                                                terminate = true;