Regular Expressions 101

Community Patterns

Regex for Nigerian Phone Number

0

Regular Expression
PCRE2 (PHP >=7.3)

/
0([7,8,9])([0,1])\d{8}$|234([7,8,9])([0,1])\d{8}$
/
gm

Description

As more and more nigerians get new phone numbers daily, the main telcom companies in Nigerian increase the varieties of numbers to accomodate this greater demand. This regex is needed to accomodate the new varieties of accessible numbers

Submitted by anonymous - 2 years ago