Fix handling of parentheses inside bracker expressions in RegEx
Update ignores
return tmp;
}
+template<>
+inline std::string lexical_cast<std::string>(const std::string &s)
+{
+ return s;
+}
+
template<typename T>
std::string lexical_cast(const T &v, const Fmt &f=Fmt())
{
bool has_branches=false;
unsigned level=0;
bool escape=false;
+ unsigned bracket=0;
string::const_iterator end;
for(end=iter; end!=expr.end(); ++end)
{
if(escape)
escape=false;
+ else if(bracket)
+ {
+ if(bracket==3 && *end==']')
+ bracket=0;
+ else if(bracket==1 && *end=='^')
+ bracket=2;
+ else
+ bracket=3;
+ }
else if(*end=='\\')
escape=true;
else if(*end=='(')
else if(level==0)
has_branches=true;
}
+ else if(*end=='[')
+ bracket=1;
}
if(level>0)