title: How to escape parentheses with li:textequals
body: <p>UPDATE:  Added the textEquals selector code.</p>
  
  <p>I am using jquery and autocomplete for a field in my web application.</p>
  
  <p>I have a "change" event that ensures the user chose a valid value from the autocomplete list.  This event works great except when there are parentheses in the chosen value the li:textequals selector does not work.</p>
  
  <p>How do I escape the parentheses in the text that I'm searing for with li:textequals?</p>
  
  <pre><code>    change: function (event, ui) {
          //if the value of the textbox does not match a suggestion, clear its value             
          if ($(".ui-autocomplete li:textEquals('" + $(this).val() + "')").size() == 0) {
              $(this).val('');
          };
  </code></pre>
  
  <p>textEquals selector code:</p>
  
  <pre><code>$.expr[':'].textEquals = function (a, i, m) {
      return $(a).text().match("^" + m[3] + "$"); 
  };
  </code></pre>