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-z]+([a-z0-9-]*[a-z0-9]+)?(\.([a-z]+([a-z0-9-]*[a-z0-9]+)?)+)*$
Description
A simple regex which should validate a domain name according to RFC 1035 updated to match domain names with hyphens
Matches
www.domain.com | w123.d42omain.c43om | ww-w.d-omain.com
Non-Matches
1www.domain.com | www.1domain.com | www.domain.com-
Author Rating: Not yet rated. Tinus Norstved
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

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