如果模式"regular"是变量st的子字符串,我想返回输出"匹配".这可能吗?
int main()
{
string st = "some regular expressions are Regxyzr";
boost::regex ex("[Rr]egular");
if (boost::regex_match(st, ex))
{
cout << "match" << endl;
}
else
{
cout << "not match" << endl;
}
}
Run Code Online (Sandbox Code Playgroud)