[Solved] regular expression for indian phone number

[ad_1]

You can try

^\+?[0-9-]+$

See it here on Regexr

The important parts are the anchors ^ and $ for the start and the end of the string. I added also \+? at the start, to match an optional +. The + needs to be escaped since it is a special character in regex, the ? after it makes it optional.

Of course this is a very simple pattern, be aware that e.g. “—–” would also be valid.

5

[ad_2]

solved regular expression for indian phone number