RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find UK Domain Names
Expression
^(([a-z][0-9])|([0-9][a-z])|([a-z0-9][a-z0-9\-]{1,2}[a-z0-9])|([a-z0-9][a-z0-9\-](([a-z0-9\-][a-z0-9])|([a-z0-9][a-z0-9\-]))[a-z0-9\-]*[a-z0-9]))\.(co|me|org|ltd|plc|net|sch|ac|mod|nhs|police|gov)\.uk$
Description
UK domain names. Includes the following restrictions from Nominet as at time of posting: 1.Only a-z, 0-9 and hyphen may be used. 2.First or last character may not be a hyphen. 3.Third and fourth characters may not both be hyphens. 4.Third level domain may not be a single character. 5.Third level domain may not be two letters or two numbers. 6.Third level domain may be one letter and one number. This does not yet include the following restrictions: 1.Whole domain may not be longer than 64 characters in length. 2.Third level domain may not duplicate any top/second level domain.
Matches
zeropanic.co.uk | z2.co.uk | 1-1.org.uk
Non-Matches
zeropanic.com | z.co.uk | zz.co.uk
Author Rating: Not yet rated. Amos Hurd
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Pattern Title
Name: naz
Date: 1/31/2009 12:04:20 AM
Comment:
Dear Amos..Your Regular Expression about UK domain names is very great.I like it!I want to implement to validate my domain name.I'm from Malaysia.Actually I want find the domain name that validate double dot(..) and double dash(--).I already test your expression.It fulfill my need to validate the domain name.I alter the expression and add .my(to check domain name : free.com.my). But cannot check for .my(free.my).How can i alter your expression to ensure that it match the free.my?Can u help me?


Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials