DD
DevDash

Regex for Indian Phone Number

Regex Pattern

^(?:\+91[- ]?)?[6-9]\d{9}$

Indian mobile number with optional +91 country code

Quick Answer

The regex pattern for indian phone number is `^(?:\+91[- ]?)?[6-9]\d{9}$`. Indian mobile number with optional +91 country code. This works in JavaScript, Python, Ruby, PHP, Java, and most regex engines that support PCRE syntax.

Test Examples

InputResult
9876543210✓ Matches
+91 9876543210✓ Matches
+919876543210✓ Matches
1234567890✗ No match
+91 5432109876✗ No match
987654321✗ No match

Code Examples

javascript

const regex = /^(?:\+91[- ]?)?[6-9]\d{9}$/;
const isValid = regex.test(value);

python

import re
pattern = r'^(?:\+91[- ]?)?[6-9]\d{9}$'
if re.match(pattern, value):
    print("valid")

ruby

pattern = /^(?:\+91[- ]?)?[6-9]\d{9}$/
if value =~ pattern
  puts "valid"
end

php

if (preg_match('/^(?:\+91[- ]?)?[6-9]\d{9}$/', $value)) {
    echo "valid";
}

java

String pattern = "^(?:\\+91[- ]?)?[6-9]\\d{9}$";
boolean isValid = value.matches(pattern);

Frequently Asked Questions

Related Regex Patterns

Want API access + no ads? Pro coming soon.