Ok If you want to match a floating point numbers use this ^[0-9]*\.?[0-9]+$
You can use this to validate whether a user has entered a number (2) or number with decimals (2.45453).
But if you only want to match whole numbers like 2, 3, 333, 545 etc. use this ^[0-9]+$
How to match a specific number of numeric characters
For example, If I want 10 digit numeric character set - ^[0-9]{10}$
0 comments:
Post a Comment