Description
code:
#include <iostream>
#include <regex>
int main() {
const char* pattern = "\\$\\_se";
std::regex regexObj(pattern);
const char* testString = "$_se";
if (std::regex_match(testString, regexObj)) {
std::cout << "匹配成功!" << std::endl;
} else {
std::cout << "匹配失败!" << std::endl;
}
return 0;
}
error:
libc++abi: terminating due to uncaught exception of type std::__1::regex_error: The expression contained an invalid escaped character, or a trailing escape.
Program terminated with signal: SIGSEGV