Voglio restituire l'output "match" se il pattern "regular" è una sottostringa di variabile st. È possibile?boost regex sub-string match
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;
}
}
Avete provato? Se è così, cosa è successo? –
sì, ottengo "non corrisponde" se st = "regolare" ottengo "corrispondenza" – bob