Regex for validating domain name

NET Framework Available since 1.1 Portable Class Library Supported in: portable .regular expression pattern to separate the domain name from the email address. Microsoft is conducting an online survey to understand your opinion of the Technet Web site.

A really common example of this is the The Power Shell script I have written requires a username, which is then used to delete alerts in Sharepoint for that user. The check is just for a string of the correct format - since it takes a little while to process the script on a large Sharepoint install I want to check the syntax at least is correct otherwise it takes 10 - 30 seconds to find out you made a typo.

It wouldn't be quick for me :-), plus I want to make this script available more widely - wouldn't that require hard coding some stuff into the script or require additional parameters?

It just makes more sense, especially from a future maintainability perspective, and will make things easier for you in the future.

The IP address part is actually very efficient on its own, so there are no further changes I would make to this part: The first group is matched by both, the second group is matched by only your regex, and the last group is matched by neither.

Third, according to MS KB Article 938447 certain characters are treated as equal in user names / objects.

A quick test shows Power Shell correctly matching that the mentioned characters with an umlaut match your regex, so be careful if you are using it to create accounts that the account may still fail in strange cases.

Note that the regular expression is compiled using the System. This pattern can be repeated one or more times, and must be followed by the top-level domain name.

[0-9a-z]*.) [a-z0-9][-a-z0-9][a-z0-9]))$` is interpreted as shown in the following table. If the character that follows @ is not an opening bracket, match one alphanumeric character with a value of A-Z, a-z, or 0-9, followed by zero or more occurrences of a word character or a hyphen, followed by zero or one alphanumeric character with a value of A-Z, a-z, or 0-9, followed by a period. To determine whether an email address is valid, pass the email address to the System.

) but maximum length restrictions are not enforced.


  1. Many of the regular users here simply refer to us as scsc.

  2. Chat in a free live sex chat or have virtual sex online! Search adult personals and find sex opportunities in your city!

  3. Some of these websites are purely meant for video chatting, but they serve as the perfect platform for people looking for something else.

  4. As a result, fewer boys are actually asking girls out on one-on-one dates.

  5. A New York Times report described the story of Justin Berry, a 13-year-old boy who, after hooking up his webcam and listing himself on an online forum in order to make friends, was propositioned by older men to strip and masturbate on camera.

  6. While Real Chat was originally a chat server, we have expanded it to include a full featured video chat application/plugin which can be embedded into any website or blog.

  7. Join our growing singles community in New Jersey and Get Connected with free mail, forums, blogs, IM, and chat. Communicate free with quality, successful, fun, exciting, sexy New Jersey singles - free of any charges whatsoever. Join New Jersey Dating, It's 100% FREE » I am in medical field. Good company, good food I don't want to see nor hear any BS looking for someone to except respest me for me loving caring a gentleman I love to listen to reggae music it relaxes me and more love poetry it can be romantic I may be a little picky about who I need to be with y God fearing, Caring, honest, respectful, humorous but serious when need to be, willing to share more about myself through pleasant conversation.

  8. My approach to counseling is one that aims to empower clients by giving them the skills and tools they need in order to apply what they learn in therapy to their real life situations.

Comments are closed.