[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: how to validate if a QString contains a FQNH?
From:       Richard Garand <richard () garandnet ! net>
Date:       2002-08-18 2:10:34
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On August 17, 2002 02:32 pm, Carsten Niehaus wrote:
> QRegExp exp("^(\\w{1,256})\\.([a-z]{2,6})$", false);
>     if (inp.contains( exp )) valid = TRUE;
>     else valid = false;
>
> But this is not working for eg www.kde.de. What is the most intelligent way
> to hadle this problem? The is QHostAddress but this is only for IPv4 and
> IPv6 (takes only IPs (uint)).

How about using "^(\\w{1,256})+\\.([a-z]{2,6})$" (added the +)? That would 
allow an unlimited number of subdomains before the top-level domain.
- -- 
Richard Garand   - r i c h a r d @ g a r a n d n e t . n e t
ICQ: 12190132 - http://www.garandnet.net
I love mankind ... It's people I hate.
                -- Schulz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9XwIkjuZKnjxs0fMRAhhkAKD6p/GXhOpPBA3NI7fuGmq9ExK9ZQCg3PZ6
ALF2bnBtcwaJdPMNPXwxIag=
=EFPZ
-----END PGP SIGNATURE-----


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic