I'm trying to create a regular expression that tests true when a figure entered into a field is 6 or less figures.
I've tried
var myReg1 = /\d{,6}/;
var myReg1 = /[0-9]{,6}/;
but it either doesnt allow less than 6 figures or always equates to false. Whats wrong with this?
Matt
"Success is 10% inspiration, 90% last minute changes
I've tried
var myReg1 = /\d{,6}/;
var myReg1 = /[0-9]{,6}/;
but it either doesnt allow less than 6 figures or always equates to false. Whats wrong with this?
Code:
function regExpAmountIs_valid( text ){
var myReg1 = /\d{,6}/;
alert(myReg1.test(text));
}
Matt
"Success is 10% inspiration, 90% last minute changes