我正在使用正则表达式格式化输入字符串,我的问题是我的字符串必须替换太多不同的值,因此我必须使用许多正则表达式。
我的问题是,我可以重新定义正则表达式以节省系统内存吗?
std::regex y_re("y+");
y_re("a+"); // can I do this,it shows error but is there a way to reuse regex?
我正在使用正则表达式格式化输入字符串,我的问题是我的字符串必须替换太多不同的值,因此我必须使用许多正则表达式。
我的问题是,我可以重新定义正则表达式以节省系统内存吗?
std::regex y_re("y+");
y_re("a+"); // can I do this,it shows error but is there a way to reuse regex?