mardi 31 mai 2022

To find the string that are not matching using regex pattern

I want to return a bool value for the unmatched string

QRegExp rx("(?!test)");
bool unmatched = rx.exactMatch("txt"); false
if(rx.isValid()){
  return unmatched;
}

It returns false every time no matter what string is passed. How can I match the same values?

Aucun commentaire:

Enregistrer un commentaire