Optimize regular expression for filtering thousands of HTML select options
问题 Background I developed a jQuery-based shuttle widget for HTML select elements because I could not find one that was minimally codified and offered a regular expression filter that compensated for diacritics. Problem When a few thousand entries are added to the select , the regular expression filter slows to a crawl. You can see the problem as follows: Browse to: http://jsfiddle.net/U8Xre/2/ Click the input field in the result panel. Type any regular expression (e.g., ^a.*ai ). Code I believe