How to validate regular expression which allow both decimals as well as integers
need to like
output 0.1, 1,1.123 etc
not enter 0
How to validate regular expression which allow both decimals as well as integers
need to like
output 0.1, 1,1.123 etc
not enter 0
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Muhammad Imran AnsariPosted Mar 3, 2022, 5:40 AM
Regular Expression is : ^[1-9]\d{0,9}(\.\d{1,3})?%?$
[1-9] : for integers which allows integers from 1 to 9
d{0,9}: this will take up to 10 digits
\. : for decimal d{1,3} : for decimal up to three digits