Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
^01[0125]\d{8}$
"
gm

Description

To check for Egyptian phone numbers using a regular expression Format of Egyptian phone numbers: It starts with 01 (indicating mobile numbers). Followed by one of the following digits representing the mobile provider: 0 for Vodafone. 1 for Etisalat. 2 for Orange. 5 for We. Followed by 8 more digits.

Submitted by Assem ELQersh - 2 months ago