- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 06:57 AM
Hi All ,
I need to create regex to restrict the value from 0 to 30.0 . but it should not allow more than 30.1 . that field is numeric value
Thanks,
Chandan
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 07:41 AM - edited 12-08-2023 07:52 AM
As said, before... please share your script if it's not working. This regex is correct for what you asked Only allow for values 0 until (and including) 39.0
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 07:34 AM - edited 12-08-2023 07:35 AM
Sorry, missed a bit 🙂
/^(?:39(\.0)?|3?[0-8](\.[0-9])?|2?[0-9](\.[0-9])?|1?[0-9](\.[0-9])?|0?(\.[0-9])?)$/
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 07:39 AM
not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 07:41 AM - edited 12-08-2023 07:52 AM
As said, before... please share your script if it's not working. This regex is correct for what you asked Only allow for values 0 until (and including) 39.0
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 07:40 AM
If it is a numeric field then why dont you just try below:
if(g_form.getValue("numeric_field_name") < 39) then do something.
Try this. Regex operation is needed on string fields. As it is already a number field so people will write only numbers on it.
If still doesnt work try using parseInt(numeric field value);