Skip to content

Instantly share code, notes, and snippets.

@MoienTajik
Last active April 22, 2024 06:01
Show Gist options
  • Star 47 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save MoienTajik/acd3dbb359054bd22e06cc97281934eb to your computer and use it in GitHub Desktop.
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

@rezacloner1372
Copy link

^09(1[0-9] |2[0-2] |3[0-9] |9[0-9]) [0-9]{7}$

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