View Full Version : [SOLVED] store.filter casesensitive

3 Feb 2008, 1:37 PM
another problem:
I have in my code:

var rgfilter = new RegExp(n+"*");

but filter works casesensitive. What's wrong?

3 Feb 2008, 1:51 PM
Pass the 'i' option to the regex (ignore case).

var rgfilter = new RegExp(n+"*", "i");

3 Feb 2008, 11:19 PM
Heh..okay, thanks.
I thought that ignore case is what last false do. So its meant to use only without regex? I can live with that, but I can't catch logic behind, it still something what MS is used to call "feature" for me.

4 Feb 2008, 8:43 AM
The docs arent clear about this but this is what i would guess;
the filter can accept either a string or a regex object. when using a string, it likely constructs a regex internally, and the "caseSensitive" option is added based on what was passed. however if you construct your own regex i will ignore that since it cannot modify the passed in regex options. the same would be true of the "anyMatch" config option.