Title |
Test
Find
UK Landline including VOIP
|
Expression |
^(02\d\s?\d{4}\s?\d{4})|((01|05)\d{2}\s?\d{3}\s?\d{4})|((01|05)\d{3}\s?\d{5,6})|((01|05)\d{4}\s?\d{4,5})$ |
Description |
Based on the source listed below. I have added in the 05 prefix for allowing UK voip landlines. I dont know if the spacings are all ofcom approved like the original regex but the patterns it supports are:
029 99999999 or 029 9999 9999; 0199 9999999 or 0199 999 9999; 01999 99999; 01999 999999; 019999 9999; 019999 99999; 0599 9999999 or 0599 999 9999; 05999 99999; 05999 999999; 059999 9999; 059999 99999; |
Matches |
020 1234 5678 | 0123 4567890 | 01234 456789 | 05234 456789 |
Non-Matches |
02476 123456 | 0845 123456 | 07712 345678 | 0800 100 2496 |
Author |
Rating:
Not yet rated.
Matthew Harris
|
Source |
http://www.regexlib.com/REDetails.aspx?regexp_id=982 |
Your Rating |
|
Title: More UK formats than that.
Name: Steve.
Date: 11/4/2011 5:40:13 AM
Comment:
Most UK telephone numbers can have either 9 or 10 digits after the 0 trunk prefix. The initial 0 is omitted when calling from abroad.
01 and 02 area codes should have parentheses around them if the local number part does not begin with a 0 or 1. 01 and 02 area codes do not have parentheses around them if the local number part begins with a 0 or 1. These are National Dialling Only ranges.
All other area codes do not have parentheses around them as the area code is required for all calls. Number formats are expressed as:
2+8 to represent (02x) xxxx xxxx [in 5 areas] or 05x xxxx xxxx or 070 xxxx xxxx or 076 xxxx xxxx.
3+7 to represent (011x) xxx xxxx [in 6 areas] or (01x1) xxx xxxx [in 6 areas] or 03xx xxx xxxx or 08xx xxx xxxx or 0800 xxx xxxx or 09xx xxx xxxx.
3+6 to represent 0500 xxxxxx or 0800 xxxxxx.
4+6 to represent (01xxx) xxxxxx [in 580 areas] or 07xxx xxxxxx.
4+5 to represent (01xxx) xxxxx [in 41 areas].
5+5 to represent (01xx xx) xxxxx [in 12 areas].
5+4 to represent (01xx xx) xxxx [in 1 area].
Valid formats include:
(011x) - 3+7.
(01x1) - 3+7.
(01xxx) - 4+6 or 4+5.
(01xx xx) - 5+5 or 5+4.
(02x) - 2+8.
03xx - 3+7.
05x - 2+8.
0500 - 3+6.
07xxx - 4+6.
070 - 2+8.
076 - 2+8.
08xx - 3+7.
0800 - 3+7 or 3+6.
09xx - 3+7.
There are a small number of exceptions such as 0800 1111 and 0845 4647.
The UK system is quite complex!