[Qt-interest] Regular Expression Validating Username in QT

Raja Rokkam rokkamraja at gmail.com
Tue Jan 12 13:55:19 CET 2010


Hi Robert,

           Thanks a lot, this regex worked like a charm :) .

-Raja.

On Tue, Jan 12, 2010 at 6:19 PM, Robert Voinea <rvoinea at gmail.com> wrote:

> On Tuesday 12 January 2010 14:39:24 Raja Rokkam wrote:
> > ^[a-zA-Z0-9][\.a-zA-Z0-9 at _$-]+
> > or
> > ^[a-zA-Z0-9][\\.a-zA-Z0-9 at _$-]+
>
> Add an "$" to the end of the regex.
> eg: ^[a-zA-Z0-9][\\.a-zA-Z0-9 at _$-]+$
> so it matches the whole string not just a substring that starts at the
> begining of the string.
>
>
> > did not help as, it is still matching asdf.@* . I have tried escaping
> the
> > dot in both the ways mentioned but to no avail.
> >
> > On Tue, Jan 12, 2010 at 5:53 PM, Ivan Kharin <korsar.akvis at gmail.com>
> wrote:
> > > > Raja.
> > > > Hi All,
> > > >           I am trying to write a regexp validating an username which
> > >
> > > contains  a-z 0-9 -.@$
> > >
> > > QRegExp usRx( "^[-_$@\.a-zA-Z0-9]+" );
> > >
> > >
> > > --
> > > Regards,
> > > Ivan Kharin
> > >
> > > _______________________________________________
> > > Qt-interest mailing list
> > > Qt-interest at trolltech.com
> > > http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
>
> --
> Robert Voinea
> IT Specialist
> +4 0740 467 262
>
> Don't take life too seriously. You'll never get out of it alive.
> (Elbert Hubbard)
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100112/67224fa8/attachment.html 


More information about the Qt-interest-old mailing list