Bonjour,
Je valide des QString avec QRegExp de la manière suivante :
Cependant la fonction renvoie toujours false.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 bool isNomProjetNorme(QString projet) { QRegExp motif("[BDEFKPT][A-Z]{3,3}[AIMTV]{0,1}[0-9]{0,2}"); return motif.exactMatch(projet); }
J'ai même modifié mon code ainsi :
et isNomProjetNorme("DABCV") retourne false !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 bool isNomProjetNorme(QString projet) { QRegExp motif("DABCV"); return motif.exactMatch(projet); }
Je dois avoir manqué quelque chose.
Partager