I'm using regular expressions and having to escape the backslash hurts readability. I assumed raw string literals would free me of this, but it seems GCC doesn't care.
Code:
std::regex ohmygod("\\((\\d+),0,'(([^']|\\\\')+)','','([^']|\\\\')*'\\)"); // ok
std::regex unescaped("\((\d+),0,'(([^']|\\')+)','','([^']|\\')*'\))"); // warning
std::regex delimited("R(\((\d+),0,'(([^']|\\')+)','','([^']|\\')*'\))R"); // warning
Code:
main.cpp:6:21: warning: unknown escape sequence: '\('
std::regex delimited("R(\((\d+),0,'(([^']|\\')+)','','([^']|\\')*'\))R");
^
main.cpp:6:21: warning: unknown escape sequence: '\d'
main.cpp:6:21: warning: unknown escape sequence: '\)'
Any way I can avoid this warning?