[Qt-interest] Regular Expression Validating Username in QT
Zimmermann, Gerrit
GZimmermann at t-systems.com
Tue Jan 12 13:17:34 CET 2010
Hallo Raja,
the dot is a special character in regexp, meaning "match any character". You need to excape it with a backslash (use \.).
Without meaning to be insulting: you should definitely reread a primer on regexp, at least the one in the QT documentation, but I'd recommend a more comprehensive one (google).
Regards,
Gerrit
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Raja Rokkam
Sent: Dienstag, 12. Januar 2010 13:12
To: QT Mailing LIST
Subject: [Qt-interest] Regular Expression Validating Username in QT
Hi All,
I am trying to write a regexp validating an username which contains a-z 0-9 -.@$
The regexp I have now is: QRegExp usRx( "^[a-zA-Z0-9][.]*[a-zA-Z0-9 at _$-]+" ); which matches everything. If I removed the "[.]*" it jus checks for characters I need excluding the dot.
I am able to create regular expression for all the set except for dot . Whenever I try keeping the "dot" it starts taking in any character. Is there a special way in QT to do this ?
Thanks,
Raja.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100112/3cef136f/attachment.html
More information about the Qt-interest-old
mailing list