[Qt-interest] Regular Expression Validating Username in QT

Raja Rokkam rokkamraja at gmail.com
Tue Jan 12 13:53:25 CET 2010


Hi Gerrit,

         Probably you missed my earlier mail, I have already tried escaping
the dot character using \. as well as \\. but to no avail.

Thanks,
Raja.

On Tue, Jan 12, 2010 at 5:47 PM, Zimmermann, Gerrit <
GZimmermann at t-systems.com> wrote:

>  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/ffd9d1d7/attachment.html 


More information about the Qt-interest-old mailing list