PDA

View Full Version : regex that works with javascript but doesn't work with EXTJS



flamant
26 Nov 2010, 3:54 AM
Hi,

I have the following regex that works with javascript :



new RegExp('^[0-9]{2}[0-9]?(\\.[0-9]?)?$').test('111.') --> true


But when I use it with a NumberField :



new Ext.form.NumberField({
id: "I" + fieldId,
...............................
regex: new RegExp('^[0-9]{2}[0-9]?(\\.[0-9]?)?$'),
...........................
})


the value '111.' is not valid

May be I don't use it correctly with EXTJS ?

Thank you in advance for your answers