X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstrings%2Fregex.cpp;h=c62405614525dd85b32a73361bd78133e03ef29f;hp=9167c6b8a9e6ae0f75fd52206bb96efe45a9424b;hb=c2530205a67e5d0b341827287151978652b91aaa;hpb=f24e7b96e76b63c9b9b8a6bce4c7a9db64276ea8 diff --git a/source/strings/regex.cpp b/source/strings/regex.cpp index 9167c6b..c624056 100644 --- a/source/strings/regex.cpp +++ b/source/strings/regex.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "format.h" #include "regex.h" @@ -129,7 +130,8 @@ Regex::Code Regex::compile(const string &expr, string::const_iterator &iter, uns Count repeat_min = 1; Count repeat_max = 1; - parse_repeat(expr, i, repeat_min, repeat_max); + if(i!=end) + parse_repeat(expr, i, repeat_min, repeat_max); for(unsigned j=0; j(-(atom.size()+jump_size), result); + write_int(-static_cast(atom.size()+jump_size), result); } else if(repeat_max>repeat_min) { @@ -157,7 +159,7 @@ Regex::Code Regex::compile(const string &expr, string::const_iterator &iter, uns } else { - list branches; + vector branches; for(auto i=iter;;) { branches.push_back(compile(expr, i, group, true));