PDA

View Full Version : [FIXED-14][3.x/2.x] Ext.escapeRe doesn't escape negative sign



mystix
6 Aug 2009, 6:54 AM
Is there any reason why Ext.escapeRe() doesn't escape the negative sign?

here's a failing test case (adapted from the NumberField code):


var regex = Ext.escapeRe('.-+');
new RegExp('[' + regex + ']');



the following override resolves this issue:


Ext.escapeRe = function (s) {
return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
}

evant
6 Aug 2009, 7:54 PM
Fixed in SVN, thanks.