Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed issue #10 with regular expression special chars not being escap…

…ed properly
  • Loading branch information...
commit c198c21c55d64b7b7858975c397062ef59e984e2 1 parent 2e8734a
@thanosp thanosp authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  jquery.awesomecomplete.js
View
2  jquery.awesomecomplete.js
@@ -212,7 +212,7 @@
if (terms[j] === '')
continue;
- terms[j] = terms[j].replace(/[\\*+?|{}()^$.#]/g, '\\$1');
+ terms[j] = terms[j].replace(/([\\*+?|{}()^$.#])/g, '\\$1');
@sandro
sandro added a note

What about brackets []?

I've had good luck with replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
var regex = new RegExp('(' + terms[j] + ')', (config.ignoreCase ? 'ig' : 'g'));
var matches = [];
Please sign in to comment.
Something went wrong with that request. Please try again.