Reputation: 9247
I have this regex:
[0-9]+,[0-9]{2}
And i can enter
10,00
1,00,
100,00,
1000,00
But i also want to have this:
1.000,00
10.000,00
100.000,00
1000.000.00
and so on... to that be valid also. Any suggestions?
Upvotes: 0
Views: 36
Reputation: 468
It's kind of hard to tell what rules exactly you're looking to follow with your regex. How about this?
([0-9]+[,.])+[0-9]{2}(,)?
This regex will allow you to match currency that uses either a , or a . and can even end in a , like in some of your examples.
Upvotes: 1