When I try to make this pattern in c++ the compiler gives me a runtime error
regex IntegerWSign("^((-)|(\+))[0-9]{1,}$");
When I try to make this pattern in c++ the compiler gives me a runtime error
regex IntegerWSign("^((-)|(\+))[0-9]{1,}$");
\+
is the valid notation in a regular expression, but inside a C++ string that needs to be \\+
.
Your expression was being interpreted as:
^((-)|(+))[0-9]{1,}$
Where that's not valid.