Skip to content
Permalink
Browse files

Autocomplete: Updated escapeRegex utility based on http://xregexp.com…

  • Loading branch information
jzaefferer committed Jul 5, 2010
1 parent 7d24c1a commit 0bbbe5f5b1ca98dd4713064c08e908dc7b2a5ede
Showing with 1 addition and 1 deletion.
  1. +1 −1 ui/jquery.ui.autocomplete.js
@@ -316,7 +316,7 @@ $.widget( "ui.autocomplete", {

$.extend( $.ui.autocomplete, {
escapeRegex: function( value ) {
return value.replace( /([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1" );
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
},
filter: function(array, term) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );

0 comments on commit 0bbbe5f

Please sign in to comment.
You can’t perform that action at this time.