★ India · regex
Regex for Indian Mobile Number
Indian mobile numbers are 10 digits and start with 6, 7, 8 or 9. This accepts the common ways people type them: with +91, 91 or a leading 0, and an optional space after the fifth digit.
- Runs in your browser
- No signup
Try the indian mobile number pattern
Read it in plain English (best-effort)
- ^start of a line
- (?:start a group (not captured)
- +91the text '+91'
- [ -]one character from: space, '-'
- ?the previous is optional
- |or
- 91the text '91'
- [ -]one character from: space, '-'
- ?the previous is optional
- |or
- 0the character '0'
- )end of group
- ?the previous is optional
- [6-9]one character from: 6–9
- \da digit (0–9)
- {4}exactly 4 of the previous
- [ -]one character from: space, '-'
- ?the previous is optional
- \da digit (0–9)
- {5}exactly 5 of the previous
- $end of a line
One sample per line works well with the m flag on anchored patterns.
The pattern, piece by piece
/^(?:\+91[ -]?|91[ -]?|0)?[6-9]\d{4}[ -]?\d{5}$/| Part | What it does |
|---|---|
(?:\+91[ -]?|91[ -]?|0)? | optional prefix: +91, 91 or a trunk 0 |
[6-9] | mobile numbers start with 6, 7, 8 or 9 |
\d{4}[ -]?\d{5} | nine more digits, optionally split 5 + 5 |
What it accepts and rejects
Every sample below is checked automatically in JavaScript and Python. The tester above is preloaded with all of them, one per line.
| Should match | |
|---|---|
9876543210 | ✓ |
+91 9876543210 | ✓ |
+919876543210 | ✓ |
09876543210 | ✓ |
98765 43210 | ✓ |
+91-6123456789 | ✓ |
| Should not match | |
|---|---|
5876543210 | ✗ |
987654321 | ✗ |
98765432101 | ✗ |
+92 9876543210 | ✗ |
+91 98765-4321 | ✗ |
0091 9876543210 | ✗ |
Copy it into your code
RE2-safeNo lookarounds or backreferences, so the same pattern works in Go's RE2 engine and in Rust's regex crate.
const indianMobileRe = /^(?:\+91[ -]?|91[ -]?|0)?[6-9]\d{4}[ -]?\d{5}$/;
export function isValidIndianMobile(value) {
return indianMobileRe.test(value.trim());
}When not to use regex for this
Format checks don't prove ownership. Send an OTP to verify the number, and store it normalised as E.164 (+919876543210) using libphonenumber.
Questions engineers actually ask
Do Indian mobile numbers still start only with 6–9?
Does it accept landline numbers?
What is catastrophic backtracking?
More india patterns
- Indian PIN CodeSix-digit PIN codes not starting with 0, optionally written as 3 + 3.^[1-9][0-9]{2} ?[0-9]{3}$
- PAN Card Number10-character PAN: 5 letters, 4 digits, 1 letter, with a valid holder-type letter.^[A-Z]{3}[ABCFGHJLPT][A-Z][0-9]{4}[A-Z]$
- GSTIN15-character GST number: state code, PAN, entity number, Z, check character.^(?:0[1-9]|[12][0-9]|3[0-8]|97)[A-Z]{3}[ABCFGHJLPT][A-Z][0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$
- Aadhaar Number Format12 digits not starting with 0 or 1, in 4-4-4 groups. Format only.^[2-9][0-9]{3}[ -]?[0-9]{4}[ -]?[0-9]{4}$
- IFSC Code11 characters: 4-letter bank code, a zero, 6-character branch code.^[A-Z]{4}0[A-Z0-9]{6}$
- Indian Vehicle NumberState registrations like MH 12 AB 1234 and Bharat-series like 22 BH 1234 AA.^(?:(?:AN|AP|AR|AS|BR|CG|CH|DD|DL|DN|GA|GJ|HP|HR|JH|JK|KA|KL|LA|LD|MH|ML|MN|MP|MZ|NL|OD|OR|PB|PY|RJ|SK|TN|TR|TS|UK|UP|WB)[ -]?[0-9]{1,2}[A-Z]?[ -]?[A-Z]{0,3}[ -]?[0-9]{4}|[0-9]{2}[ -]?BH[ -]?[0-9]{4}[ -]?[A-Z]{1,2})$
- UPI ID (VPA)username@handle virtual payment addresses like name@okaxis.^[a-zA-Z0-9][a-zA-Z0-9._-]{1,255}@[a-zA-Z][a-zA-Z0-9]{1,63}$
Or browse the full regex library.
More from the workbench
Fine print
Tools: on the house.
Engineer: by the hour.
The regex was free. Code that doesn't need one is the upgrade: typed schemas, validated once at the edge, trusted everywhere after.
I'm Himanshu, an AI and full-stack engineer. I build MVPs, AI agents and the growth plumbing around them for early-stage startups.
