title: LDAP JS with Node JS Finding users passing in patterns of string
body: <p>I am currently using LDAP JS for Authentication in Angular JS app and everything works perfectly fine.</p>
  
  <p>I am now building a new view and the requirement I have is this:</p>
  
  <ul>
  <li>I have text box in which admin will write may be a few letters of a user id present in LDAP.</li>
  <li>I want to show app matching ID present in LDAP on a typeahead/suggestions. I know how typeahead works so that's not an issue. The issue is how can I pass a rejex or pattern matching kind of a thing for <code>uid</code> in <code>search()</code> method.</li>
  </ul>
  
  <p>My sample code is here:</p>
  
  <pre><code>function GetAllLDAPUser(dnFilter, res) {
  
      client.search('uid=**WHAT-PATTERN-CAN-I-PASS-HERE**' + dnFilter, opts, function(err, result) {
  
              result.on('searchEntry', function(entry) {
  
                  // I usually read entry.object or entry.raw here , that works
  
              });
              result.on('end', function(result) {
  
                  .......
              });
          }
      }
  }
  </code></pre>
  
  <p>So the question is what should I pass in place of 
  <code>WHAT-PATTERN-CAN-I-PASS-HERE</code></p>
  
  <p>Results :
  Suppose I type <code>an</code>. The typeahead will show all user id starting with <code>an</code> like <code>ana</code>, <code>anamon</code>, <code>analisa</code> etc.</p>