What I was trying to do was have it as a basic calculator (it doesn't prevent division of 0 yet). Basically the pattern would be 0 or 1 '-' (sign), 0->infinity (excluding leading zeros such as 00001), '+' or '-' or '*' or '/' (operator), 0 or 1 '-' (sign), 0->infinity (excluding leading zeros)
So in other words:
signed/unsigned number operation signed/unsigned number
The problem seems to be with making sure there are no leading zeros so this bit:
1 2 3
(0|[1-9]\\d*)
//or
(0|[1-9][0-9]*)
from my understanding this means match 0 or 1-9 and 0-9(<-0 or more times)
can you not use ranges when using the alternate pattern? because if I do (0|1) it works fine but (0|[1-9]) doesn't and I'd prefer to not have to type each value manually instead of a range.
Very cool didn't realize you could put a R before and make it a raw string. Also I think it is a bit easier to read doing it your way. As far as the problem though I am not sure but it only works when I compile using clang and your flags clang++ -std=c++11 -stdlib=libc++ -O2 -Wall -pedantic-errors main.cpp -lsupc++ && ./a.out what exactly is libc++ and -lsupc++? also is there a way for me to compile it successfully with g++. I normally just use g++-4.8 -std=c++11 -Wall -Wextra -pendantic-errors main.cpp && ./a.out