I am using this regular expression: [a-zA-Z0-9\-.,:+*()=\'&_], but i am getting error like :'unterminated character class' error in this expression':
Demo Code:
Ext.getCmp('field2').addListener({
beforequery: function (e) {
if (e.query && e.query.indexOf('?') != -1) {
var temp = '';
for(var i=0;i<e.query.length;i++){
temp = temp + '['+e.query[i]+ ']';
}
e.cancel = true;
var query = new RegExp(String.format('^{0}',temp.replace(/\?/g, 'a-zA-Z0-9\.,:\+*()=\'&_-\\')));
this.expand();
this.store.clearFilter(true);
this.store.filter(this.displayField, query);
}
}
});
Errors:
1.Please someone tell me whats wrong in this, mainly with backslash.
2.when we enter desired characters in combobox they are being selected automatically..so when we want to enter new character we have to press side arrow or else remaining characters are being deleted...
Thanks once again,
Raj