Regular Expressions 101

Community Patterns

1...56789...900

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

This regex is designed to identify and extract Iranian mobile phone numbers. By using the pattern ^(0098|\+98|98|0|)(9\d{9}$), this pattern allows you to recognize phone numbers in various formats, including international and local prefixes. This tool is particularly useful for programmers and data analysts.

Submitted by Mohammad Mahdi Arbabpouri - 3 months ago