title: Implementing a Fast Javascript Search?
body: <p>Basically:</p>
  
  <ol>
  <li><p>I have a page with a textbox, and a <code>&lt;ul&gt;</code> list below it. The <code>&lt;ul&gt;</code> is populated by a list of the user's friends.</p></li>
  <li><p>The user begins typing in the name of a friend in the textbox, e.g pressing 'r'</p></li>
  <li><p>I want to immediately update the <code>&lt;ul&gt;</code> with each keypress to show only those friends whose names begin with R, e.g 'Richard, Redmond, Raheem', etc. </p></li>
  <li><p>As the user types more, I want to further restrict the names, e.g if user types 'Ri' then I only want 'Richard' in the list.</p></li>
  </ol>
  
  <p>I'm looking for ideas on how to implement the searching. Specifically, if I should use an Array or JSON class for storing the list of friends, if there's any regular expression I should use, etc?</p>
  
  <p>Also which jQuery event should I use for listening to the keypress events?</p>