正则表达式支持
c标准库
参考资料:https://blog.csdn.net/qq_32588507/article/details/51392063
c++标准库
regex
regex_match 完全匹配
regex_search
regex_replace
regex_iterator
regex_token_iterator
参考资料:https://blog.csdn.net/qq_17044529/article/details/82696474
boost库regex:
regex
regex_match 完全匹配
regex_search
regex_replace
regex_iterator
…
参考资料:https://blog.csdn.net/barry8865/article/details/81028935
示例:替换指定得字符串
void replacestr()
{
regex reg("hello");
std::string str = regex_replace("hello world", reg, "test");
cout << str << std::endl;
//output test world
}