From 0bbbe5f5b1ca98dd4713064c08e908dc7b2a5ede Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Mon, 5 Jul 2010 10:05:00 +0200 Subject: [PATCH] Autocomplete: Updated escapeRegex utility based on http://xregexp.com/xregexp.js --- ui/jquery.ui.autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index bd7420df8..c9dd11609 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/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" ); -- 2.39.5