78
Views
6
Comments
Solved
Phone No Regex

Hi Team,

I am checking regext using regexsearch for phoeneno for 10 digits and hiphen is allowed anywhere with 10 digits

"(^[0-9]{10}-?)"

Please suggest as above not working
2025-04-17 05-42-16
Ajit Kurane

Hello Ujwala,

Please refer below oml,


You just need to make changes for hiphen rest things work according to you.

You can check demo here,

https://personal-xyog61l7.outsystemscloud.com/Rolecheck/PhoneNumberValidation?_ts=637782771239769229


Regards,

Ajit Kurane.

Mobile Number.oml
2018-10-29 08-31-03
João Marques
 
MVP

Hi Ujwala,


You can try the following Regex ^(?:\d[-]?){10}$

  • \d for the digit.
  • [- ] for the character after the number
  • ? for checking if there is one - after the number
  • {10} checks if it has 10 digits


You can also check the Regex How-To Forge component, that allows you to test your regex (it has a demo like on the screenshot above) and it shows how to use Regex expressions not only on server side but also on client side.


Kind Regards,
João

UserImage.jpg
ujwala T

Hi,

I have tried this 

But it is not working,It is taking only 10 digits but no hiphen,It has to be total 10 numbers and hiphen allowed anywhere.

Regards,

UserImage.jpg
ujwala T
Solution
2020-11-23 05-30-56
Angel Saxena

Hi Ujwala,

Could you help providing a sample string which should pass and also the one which you except to fail?


Thanks!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.