powershell v3.0 - How Can I Regex Match The Common Name of This DN? -
given string cn=smith\, john,ou=users,ou=it,dc=contoso,dc=com, seeking match complete common name, including comma after it. i'm trying remove part, matching other part work too.
the result after removal or filter ought ou=users,ou=it,dc=contoso,dc=com.
i tried ^.+(?=,ou=) no flags captures cn=some\, guy,ou=users
the language/regex standard powershell, can figure out conversion standard, solution better am.
you can try this: ^.+?(?=,ou=), , shell match entire string until ou part.
Comments
Post a Comment