Help: Validate Domain Name by Regular Express

From: Date: Sat, 08 Jan 2011 08:55:31 +0000
Subject: Help: Validate Domain Name by Regular Express
Groups: php.general 
Request: Send a blank email to php-general+get-310600@lists.php.net to get a copy of this message
PHP 5.3 PCRE Regular Express to match domain names format according to RFC 1034 - DOMAIN NAMES - CONCEPTS AND FACILITIES /^ (
  [a-z]                 |
[a-z] (?:[a-z]|[0-9]) | [a-z] (?:[a-z]|[0-9]|\-){1,61} (?:[a-z]|[0-9]) ) # One label
(?:\.(?1))*+        # More labels
\.?                 # Root domain name
$/iDx This rule matches only <label> and <label>. but not <label>.<label>... I don't know what wrong with it. Thank you.

« previous php.general (#310600) next »