Phone number validation on catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 06:46 AM
Hi ,
Phone number validation on form it should contains only numbers with - and +
How can I achieve this one from regex?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 01:32 PM
Hi @raj99918,
Configure the regular expression for phone number and use that on catalog item variabls.
^(\+\s?\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]\d{4}$
Set the regex with phone number variabbles.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 12:09 AM
HI @AshishKM Thanks for the reply its failing no luck just I want regrex like Contain numbers (0 to 9), dash (-) and plus (+) character could you please give regrex for this one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 01:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 08:34 PM
Hi, @raj99918
You can check the following article:
Solved: Regex for phone numbers. - ServiceNow Community
Also try this regex:
/^\+?\d+(-\d+)*$/;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 12:03 AM
Hi @kkrushkov But its not allowing the country code numbers with any country code like India +91 9999999999, UK +44 123567890 its just allowing the just numbers and - like this However I want regrex to allow which contains numbers - +