PDA

View Full Version : newbie question on RegExp (regular expression) for the maskRe property of TextField



flamant
17 Oct 2011, 6:08 AM
Hi
I implemented the following RegExp


var regex1 = new RegExp('^[\\w\\s\\(\\)\\[\\]\"\',;:\\/!\\?\\-=%\\+]'+(field.fldSize == 0 ? '{0,2000}' : ('{0,'+field.fldSize+'}'))+'$', 'i');

and
var field = new Ext.form.TextField({
.....
.....
maskRe: regex1,
......});


to allow word characters, white space, (, ), [, ], ", ', coma, ;, :, /, !, ?, -, =, + characters
For my example, I have field.fldSize = 9 so that at the end of the regular expression, I have {0,9}

But unfortunately I can enter 10 or more "a" characters and I don't see why

Thank you in advance for your help