QTextCharFormat format;
QString text = “123 good of”;
QString patten = "\bgood\b";//represents the matched character is good \b represents the matching boundary, \b represents broad
QRegExp expression(patten);
int index = text.indexOf(expression);//If the attack is successful, it will return the matching position,
if it fails, it will return -1 if(index){ qDebug()<<matching success;
}