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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((CN=(['\w\d\s\-\&\.]+(\\/)*(\\,)*)+,\s*)*(OU=(['\w\d\s\-\&\.]+(\\/)*(\\,)*)+,\s*)*(DC=['\w\d\s\-\&]+[,]*\s*){1,}(DC=['\w\d\s\-\&]+\s*){1})$
Description
Matches LDAP path (AdsPath) in Active Directory. Modified version of regex which has been found in library. Accepts spaces after , character. Also \/ and \, sequences (escapes) in CN or OU name are accepted.
Matches
CN=John Smith, OU=Acc, DC=acme, DC=com | CN=John\, Smith US\/EXT, OU=Acc, DC=acme ,DC=com
Non-Matches
CN=John Smith, OU=Acc, DC=acme | CN=John\, Smith\, OU=Acc, DC=acme, DC=com
Author Rating: Not yet rated. Artur Faszczewski
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: Missing , in the regex
Name: Link
Date: 10/6/2023 8:26:16 PM
Comment:
I think the last part of this regex should be ...{1,})$ instead of ...{1})$


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