Skip to content

Instantly share code, notes, and snippets.

@MoienTajik
Last active November 12, 2025 11:07
Show Gist options
  • Select an option

  • Save MoienTajik/acd3dbb359054bd22e06cc97281934eb to your computer and use it in GitHub Desktop.

Select an option

Save MoienTajik/acd3dbb359054bd22e06cc97281934eb to your computer and use it in GitHub Desktop.
Regex For Iranian Mobile Phone Numbers

Regex For Iranian Phone Numbers

This regex supports all kinds of Iranian mobile phone numbers :

^(\+98|0)?9\d{9}$


Regex Visualized

Usage in JavaScript :

var regex = new RegExp('^(\\+98|0)?9\\d{9}$');
var result = regex.test('+989031234567');

console.log(result);

Regex Tester Demo

JSFiddle Demo

@Rava-milad
Copy link

this support all new mobile operator format
/^09(0[1-5]|1[0-9]|2[012]|3[0235-9]|9[0-4]|98|99)\d{7}$/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment