Closed alexrogers closed 10 years ago
hi @uberweb!
I'm found another way:
val = val.replace(new RegExp("[({[^.$*+?\\\]})]","g"),'');
this strip completely any regexp special char!
I'm thinking about question... $ is better remove.. on server side using nosql database may be cause problems...
@stefanocudini that worked for me on a static list. I'm not sure of the repercussions of using it in ajax request.
Trying to filter using '$' but this issue applies to any special character in a javascript regexp. Because the character is not escaped the results are incomplete.
I added some code to escape the character when required after line 43. Not thoroughly tested yet and it's possibly what you were trying to do anyway.
code taken from http://stackoverflow.com/a/9310752/184129