title: how to extract username from ldap using regex and java
body: <p>I have a text which looks like this:</p>
  
  <pre><code>CN=BillNameOne,OU=departmentOne,OU=departmentTwo,DC=domain,DC=com
  CN=MaryNameTwo,OU=departmentOne,OU=departmentTwo,DC=domain,DC=com
  CN=BillName,OU=departmentOne,OU=departmentTwo,DC=domain,DC=com
  CN=MaryName,OU=departmentOne,OU=departmentTwo,DC=domain,DC=com
  </code></pre>
  
  <p>How can I extract the usernames from the string in java using regex. And I want username which start with Bill.</p>
  
  <p>What should be the regex? 
  I can extract username with this but how do I choose usernames which start with Bill?</p>
  
  <pre><code>"CN=(.*?),"
  </code></pre>