I am having trouble with a small regular expression which matches a single pipe character. I am always getting a regex_error exception with the error_escape code.
In it's most basic form, the escape on the pipe does not work in posix, extended posix or default syntax modes
std::regex("\\|", std::regex_constants::extended);
I have tried all 3 modes with 2 backslashes, just one and none.
I even tried to match using the escape for the actual value of the pipe character:
\\0x7c or \0x7c
With the same result.
What am i doing wrong? All The other regular expressions in my code work, including several similar literal character escapes (+, *, etc).
(Please do not suggest boost)