📜  cpp 正则表达式匹配 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:44.995000             🧑  作者: Mango

代码示例1
std::regex re("Get|GetValue");
std::cmatch m;
std::regex_search("GetValue", m, re);  // returns true, and m[0] contains "Get"
std::regex_match ("GetValue", m, re);  // returns true, and m[0] contains "GetValue"
std::regex_search("GetValues", m, re); // returns true, and m[0] contains "Get"
std::regex_match ("GetValues", m, re); // returns false