[Solved]Invalidate "\" with QRegExpValidator
-
@ui_->nameTemplateEdit->setValidator(new QRegExpValidator(QRegExp("[^\<>?:|"]"), this) );@
I could invalidate "<", ">", "?", ":", "*", "|", """ but can't invalidate ""
How could I fix this?Thanks -
The first escape sequence escapes from the C++ compiler, the second one from the regular expression.
So to get a "" in the regular expression literally, you write "\" as regexp.
To get "\" in a C++ string, you write "\\" in the code file. -
Thank you very much