Regular Expressions 101

Community Patterns

Your search did not match anything

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:0098|\+?98|0?)(9\d{9})$
/
gm

Description

Iran mobile number regex

This pattern is designed to validate Iranian mobile phone numbers written in either domestic or international format. It recognizes optional prefixes like 0, +98, 0098, or 98, followed by a 10-digit number starting with 9 — which is the standard format for all mobile numbers in Iran.

In short, it accepts numbers such as: 09138004619, 9138004619, +989138004619, 00989138004619, 989138004619, while rejecting any number with missing or extra digits or an invalid prefix.

Submitted by Mahdi Harooni ( github.com/mahdiharooniir ) - 7 days ago (Last modified 7 days ago)