I would like a salary field that only takes numbers and also numbers with maximum 2 digits after the dot. Spaces and commas are not allowed.
My RegEx below is not working it allows spaces and commas and it allows more than 2 digits after the comma
("^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.'][0-9]{2})?|(?:'[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:'[0-9]{2})?)$");
The following is what should be accepted
10000
10000.00
The following should not be accepted
10,000
10'000
10000.456
1000.47888
10 000