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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Active Directory [email protected] Format
Expression
^(?<user>.+)@(?<domain>.+)$
Description
This uses named groups to extract the user and domain portions of an Active Directory user in [email protected] format. You can use the following c# code to convert this into domain\user format: public string ConvertUserAtDomainToDomainUser(string userAtDomain) { return Regex.Replace(userAtDomain, @"^(?<user>.+)@(?<domain>.+)$", @"${domain}\${user}"); } This regex is intended to provide extraction from valid [email protected] strings rather than validate its format.
Matches
Non-Matches
bil+microsoft | microsoft\bill
Author Rating: Not yet rated. Matthew Harris
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-2021, RegexAdvice.com | ASP.NET Tutorials