Regex for Indian Mobile Number

hi Team,

i have different Mobile No’s

  1. 8880344456
  2. +918880344456
  3. +91 8880344456
  4. +91-8880344456
  5. 08880344456
  6. 918880344456

and i want to build a reg for the same of whatever format it is

@devasaiprasad_K

\+?\d{2}\s*\-?\d+

@devasaiprasad_K
If you have queries check and let me know

Hi @devasaiprasad_K

Try this:
[ \d-+]+

Hope it helps!!

Referring to the title, we can check indian phone nos on the +91 like:

grafik

As other countries can also begin with e.g a 08… we would have to check more, but recommend to add more context on this task

Hi @devasaiprasad_K

If you have indian numbers only
(\+91|91)\s?\-?\d+

Hope it helps!!

but if i want to validate whether after + the mobile number should have 9 or 8 then?

we did as with the rule
grafik

the 91 starter is checked

@devasaiprasad_K

I believe that the number is an indian number as it starts with +91 country code

Inside the for each iteration of matches
you can give an if condition like
currentitem.tostring.startswith(“+91”)

Try this
(+91[-\s]?)?[0]?(91)?[789]\d{9}

Hey @devasaiprasad_K
you can use:
(?:\+?91[-\s]?)?0?\d{10}
image
or if numbers need to start from 91 or +91 you can use:
\+?91[-\s]?[89]\d{9}
image

Hi,devasaiprasad_K


Hope it helps!!