Created
December 10, 2021 20:37
-
-
Save realslacker/fb1b112af5879448dac9ac59b9e2b715 to your computer and use it in GitHub Desktop.
Useful Regular Expressions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Relative OU Path | |
$RelativeOU = '^(?:(?:CN|OU)=(?:(?<=\\),|[^,])+(?:,(?=(?:CN|OU)=(?:(?<=\\),|[^,])+)|$))+$' | |
# Full OU | |
$OU = '^(?:(?:CN|OU)=(?:(?<=\\),|[^,])+,)+(?:DC=(?:(?<=\\),|[^,])+(?:,(?=DC=(?:(?<=\\),|[^,])+)|$))+$' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment