title: Regular expression for parsing Active Directory distinguishedName
body: <p>The value for distinguishedname in AD is typically in the format:</p>
  
  <pre><code>CN=lastName\,firstName,OU=Users - XYZ,OU=Users-Test Place,OU=UsersAll,DC=Dom1,DC=Dom2
  </code></pre>
  
  <p>I would like to parse it using a regular expression and get back the following values</p>
  
  <pre><code>CN=lastName\, firstName
  OU=Users - XYZ
  OU=Users-Test Place
  OU=UsersAll
  DC=Dom1
  DC=Dom2
  </code></pre>
  
  <p>The pattern "\w+=\w+" didn't help.</p>
  
  <p>I see the problem but am at a loss for a solution.</p>
  
  <p>Thanks for your help.</p>