I'm trying to get something recognised of the following format A1:Z9999 upper/lowercase (in other words in the range a1 to a9999 followed by a colon to Z9999). I tried using the regexp demo to try code out and my code seemed to work but putting it in my dialog box it doesn't.... Retrying it in the demo it doesn't either. Can any regexp guru's help? I've read the documentation but although its good none of the examples are near what I want to do.
QRegExp regExp
("A-Za-z][1-9][0-9][0-9]{0,3}[:][A-Za-z][1-9][0-9][0-9]{0,3}");
//QRegExp regExp("[A-Za-z][1-9][0-9]{0,3}"); //works
QRegExp regExp("A-Za-z][1-9][0-9][0-9]{0,3}[:][A-Za-z][1-9][0-9][0-9]{0,3}");
//QRegExp regExp("[A-Za-z][1-9][0-9]{0,3}"); //works
lineEdit->setValidator(new QRegExpValidator(regExp, this));
To copy to clipboard, switch view to plain text mode
Bookmarks