Regex for matching C++ string constant
问题 I'm currently working on a C++ preprocessor and I need to match string constants with more than 0 letters like this "hey I'm a string . I'm currently working with this one here \"([^\\\"]+|\\.)+\" but it fails on one of my test cases. Test cases: std::cout << "hello" << " world"; std::cout << "He said: \"bananas\"" << "..."; std::cout << ""; std::cout << "\x12\23\x34"; Expected output: std::cout << String("hello") << String(" world"); std::cout << String("He said: \"bananas\"") << String("...