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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(([a-zA-Z0-9]+([\-])?[a-zA-Z0-9]+)+(\.)?)+[a-zA-Z]{2,6}$
Description
Checks domain names. This will match all of the valid domains. It will accept TLD's that are from 2 to 6 characters. You can not have more then one dash or period next to each other. Also it will not let you have dashes at end of the words.
Matches
www.domain.com | your-domain.com | www.sub-domain.your-domain.museum
Non-Matches
.domain.com | your---domain.com | www.-sub-.com
Author Rating: The rating for this expression. Faruk Brbovic
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: almost
Name: Remi Sabourin
Date: 6/3/2008 7:52:02 PM
Comment:
a.com is a valid domain For alternative regular expression, see http://regexlib.com/REDetails.aspx?regexp_id=391


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