Apr 18th, 2010, 4:59 PM
Quote:I want users to be able ti fill in any number with up to 4 digits or 3 digits with a comma as decinal separation.
Ah, okay! Hmm... try this instead:
Code:
rules.push("reg_exp,aantal_groen,^\s*[0-9\\,]{3,4}\s*$,i,alleen cijfers en komma!");
The "[0-9\\,]" bit is a "character class". It matches any number, 0-9 and the comma (double escaped to make it work within the string). The {3,4} bit matches the preceding expression either 3 or 4 times.
I think that'll work...
- Ben