diff --git a/src/Autocomplete.js b/src/Autocomplete.js index f6cf96a..bf74e74 100644 --- a/src/Autocomplete.js +++ b/src/Autocomplete.js @@ -279,7 +279,7 @@ if (val && !(results = this.cache["r-" + val])) { // Find all matching values: escapeRgx = this.cache.escapeRgx || (this.cache.escapeRgx = /([-.*+?^${}()|[\]\/\\])/g); - matchRgx = new RegExp("^(" + val.replace(escapeRgx, "\\$1") + ".*)$", "igm"); + matchRgx = new RegExp("^(.*" + val.replace(escapeRgx, "\\$1") + ".*)$", "igm"); matchText = this.cache.values || (this.cache.values = this.values.sort().join("\n")); maxChoices = this.options.maxChoices;