A field should accept numbers between 1-100 including decimal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 08:42 AM
A field should accept numbers between 1-100 including decimal. Can anyone share the regular expression for this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 10:08 PM
Hello,
Use the below regex I tested it out woks correct:-
Please mark answer correct/helpful based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 09:50 PM
Hello @akhila13
If you want to allow 01.00, 02.33, 09.03 .. till 100.00 numbers as valid then use below regex:
^[0]{1}[1-9]{1}(\.[0-9]{1,2})?$|^[1-9]{1,2}(\.[0-9]{1,2})?$|^(100)(\.[0]{1,2})?$
if you 1.00, 2.33, 9.03 .. till 100.00 numbers as valid but 01.00, 02.33 (i.e number starting with 0) as invalid then use the below regex
^[1-9]{1,2}(\.[0-9]{1,2})?$|^(100)(\.[0]{1,2})?$

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 10:18 PM - edited ‎10-06-2022 10:18 PM
Hi Akhila,
You can use the below regex, it will work:
^(?<whole>100|\d{1,2})(?<fract>\.\d{1,8})?$
Please mark the answer correct if it helps. 🙂