I’m using this plugin
http://harvesthq.github.com/chosen/
and I have an specific problem when I search some options with blanks.
for example I have an option tha is “Antigua y barbuda”
if I type :
- Antigua y barbuda -> ok
- Antigua y -> ok
- barbuda -> ok
- y -> ok
- y barbuda -> fail
it only fails when I start writing not the first word (only in cases that has blanks)
Regex:
regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
Solved it removing “\s”