Title |
Test
Find
Pattern Title
|
Expression |
^([a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]\.)+([a-zA-Z0-9]{3,5})$ |
Description |
Host/Domain name validation for perl.
Should be combined with a check for
length <= 63 characters and that $2
is in a list of top-level domains. |
Matches |
freshmeat.net | 123.com | TempLate-toolkKt.orG |
Non-Matches |
-dog.com | ?boy.net | this.domain |
Author |
Rating:
Not yet rated.
Nathan Pitts
|
Source |
|
Your Rating |
|
Title: Actually
Name: Remi Sabourin
Date: 6/19/2004 4:26:46 PM
Comment:
More precisely, the end should be {2,6} as "museum is also a valid top level domain
See
http://regexlib.com/REDetails.aspx?regexp_id=391
Title: Incorrect for country code TLDs
Name: Tony Meyer
Date: 3/26/2003 1:47:35 AM
Comment:
This is not correct. The (3,5) at the end should be (2,5). Country code TLD's tend to be 2 chars long, not 3.