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

List:       kde-devel
Subject:    how to validate if a QString contains a FQNH?
From:       Carsten Niehaus <cniehaus () gmx ! de>
Date:       2002-08-17 20:32:40
[Download RAW message or body]

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

Hi

I need to check if a QString contains a hostname or not. Allowed are 
[0-9a-zA-Z] and _. This QRegExp is ok for 2-part FQHN, eg. kde.org:

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)).

Carsten
- -- 
The rule on staying alive as a forecaster is to give 'em a number or
give 'em a date, but never give 'em both at once.
		-- Jane Bryant Quinn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9XrLp29GaGyAowFcRAoRgAKDDnVJJoc4EFjJ3VOezbfteAyicNQCg5jKf
8bBYs97WEIC+d0ECC+wUdgM=
=31j7
-----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