Regular Expressions 101

Community Patterns

UK fixed and mobile phones

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(0(1|2|3|7|8|9)\d{9})|(0(1|55|56)\d{8})|(0800\d{6})$
/
gm

Description

Will match all fixed and mobile phone numbers with 9 or 10 digit NSN

Resource used: https://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom

Submitted by Octav - 3 years ago