Qt 6.11 is out! See what's new in the release
blog
QString & QRegExp
General and Desktop
2
Posts
2
Posters
691
Views
1
Watching
-
Hello,
i have a QRegExp
@
QRegExp("[0-9,.-]");
@
this should be allowed !i want to remove all other signs from a QString .
How can i do that ?
Please help.Thanks in advance !
-
Please use '@' tags to wrap your code here on the forum. It is easier to read this way (I've already done that for you in your post).
Remember that QRegExp is deprecated in Qt 5, you should use QRegularExpression instead.
Regarding your problem: please see the documentation, the usage of QRegExp is explained pretty decently there. "Link":http://qt-project.org/doc/qt-5/QRegExp.html. You can also use "QRegExpValidator":http://qt-project.org/doc/qt-5/qregexpvalidator.html class, if you need your validaion in GUI.