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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Domain Name
Expression
(?:[^0-9][a-zA-Z0-9]+(?:(?:\-|\.)[a-zA-Z0-9]+)*)
Description
This is a little regex to verify domain style names per RFC952. This is also found in RFC1034 and both use the terms domain name and host name interchangeably even though I believe there may be a difference. Only alpha, digit, and dashes allowed with a dot as delimiter. Must begin with alpha and not end with a dash or dot. No spaces.
Matches
abc.123 | abc-xyz | my-name.for.me
Non-Matches
123.abc | abc- | abc..
Author Rating: Not yet rated. tedcambron
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