Skip to content

Commit 22e8d7b

Browse files
authored
Shorter regex in escapeRegExChars
Removed unnecessary backslash characters. Slash character is not a regex special character and does not need to be escaped.
1 parent b45b4b1 commit 22e8d7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
utils = (function () {
3030
return {
3131
escapeRegExChars: function (value) {
32-
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
32+
return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
3333
},
3434
createNode: function (containerClass) {
3535
var div = document.createElement('div');

0 commit comments

Comments
 (0)