dhtmlxcombo won't filter by some special characters

Does anybody know why a dhtmlxcombo won’t filter by some special characters such as ^ and $? Most other characters do work for me, except for a select few. Why is that?

My filterSelf function looks like this:

[code]dhtmlXCombo.prototype.filterSelf = function(mode)
{
var text=this.getComboText();
if (this._xml){
this._lkmode=mode;
this._fetchOptions(0,text);
}

  var filter=new RegExp("^"+text.replace(/([\[\]\{\}\(\)\+\*\\\?\.])/g,"\\$1"),"i");
  this.filterAny=false;
  for(var i=0; i<this.optionsArr.length; i++){
	  var z=filter.test(this.optionsArr[i].content?this.optionsArr[i].data()[1]:this.optionsArr[i].text);
  	 this.filterAny|=z;
     this.optionsArr[i].hide(!z);
  }
  if (!this.filterAny) {
	  this.closeAll();
	  this._activeMode=true;
  }
  else {
  	  if (this.DOMlist.style.display!="block")
  	   		this.openSelect();
      if (_isIE) this._IEFix(true);
	}
     
    if (!mode && this._filterAndSelect)
    	this._correctSelection();   
    else this.unSelectOption();

}[/code]

You need replace in file dhtmlxCombo/sources/dhtmlxcombo.js this line:
var filter=new RegExp("^"+text.replace(/([[]{}()+*\?.])/g,"\$1"),“i”);
with this line:

var filter=new RegExp("^"+text.replace(/([\[\^\$\]\{\}\(\)\+\*\\\?\.])/g,"\\$1"),"i");

I did this instead (it should do the same as yours):

var filter=new RegExp("^"+text.replace(/([\[\]\{\}\(\)\+\*\\\?\.\^\$])/g,"\\$1"),"i");

Does it look good?

In my CODE part of unswer is this: ^$
var filter=new RegExp("^"+text.replace(/([[^$]{}()+*\?.])/g,"\$1"),“i”);

Yes, I did the same thing, I just put them at the end like so:

var filter=new RegExp("^"+text.replace(/([[]{}()+*\?.^$])/g,"\$1"),“i”);

Made a little demo for you - it works.
combo_demo.rar (21.6 KB)

If you will not find the reason, please, make completed demo and attach it to reproduce your issue:
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Thank you! I’ll check that out.

You are welcome!