mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Autocomplete: Updated escapeRegex utility based on http://xregexp.com/xregexp.js
This commit is contained in:
parent
7d24c1a57f
commit
0bbbe5f5b1
2
ui/jquery.ui.autocomplete.js
vendored
2
ui/jquery.ui.autocomplete.js
vendored
@ -316,7 +316,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
|
|
||||||
$.extend( $.ui.autocomplete, {
|
$.extend( $.ui.autocomplete, {
|
||||||
escapeRegex: function( value ) {
|
escapeRegex: function( value ) {
|
||||||
return value.replace( /([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1" );
|
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
||||||
},
|
},
|
||||||
filter: function(array, term) {
|
filter: function(array, term) {
|
||||||
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
|
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
|
||||||
|
Loading…
Reference in New Issue
Block a user