Validation Regex for Numbers and as well allows decimal values ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 10:15 PM
Hi All,
Actually we have Validation regex for Numbers (integers), it allows only integers, but my requirment was, along with numbers , if user wants to allows him to add decimal value it , so The Regex allows him that able to integers or able to decimal values to integers also?
The Validation regex as we have
^[0-9]*$
please help me to complete this
Thanks
Deepika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 10:22 PM
Hi Deepika,
Please try below
^[1-9]\d*(\.\d+)?$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 10:22 PM
Hello @Deepika61,
Please refer to the below link:
https://www.servicenow.com/community/developer-forum/regex-for-decimal-validation/m-p/2103267
Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik