- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
another uk telephone number regex. This was adapted from another on this site I added support for hyphens and for london shorthand numbers ie. 8234-1234 72341234 Still want to be permissive where possible....Still need to sort out the all zeros, also not sure if numbers with 4 digits followed by 7 used in london 0208-234-1234 is the area of the uk where this occurs, or all areas outside of london are in format 5 digits followed by 6 digits ie. 01608 123456. If that is the case for the 4-7 pattern only 0208 or 0207 could be enforced.
0208 993 5689 | 0208-993-5689 | 89935689
1608 123 456
Author Rating: The rating for this expression. Matt Baskey
Your Rating
Bad Good

Enter New Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Incomplete and incorrect.
Name: g1smd
Date: 10/27/2012 12:53:35 PM
This RegEx pattern is incomplete, incorrect and has bad syntax. The pattern matches UK 4+6 and 3+7 numbers but fails to match valid UK 2+8, 4+5, 5+5 and 5+4 numbers. The (\s*(7|8)(\d{7}|\d{3}(\-|\s{1})\d{4})\s*) part is wrong in many ways. The (7|8) simplifies to [78] for example, and \s{1} should be just \s here. The (\-|\s{1}) could be [\s-] more simply. London local numbers might be 8 digits long but they don't just begin with the digits 7 or 8. They now also begin with a 3. See for pattern matching all UK formats, with a selection of common dial prefixes also allowed.

Title: Simplification.
Name: g1smd
Date: 8/3/2012 8:01:32 PM
(\-|\s{1}) simplifies to [\s-] for example.

Title: London Area codes wrong
Name: Phil
Date: 11/6/2011 7:29:44 PM
FYI, there is just one area code for London, 020 - it's not 0207 & 0208 for inner/outer anymore. You can prove this to yourself by dialing a London number from another London number and leaving off the area code (for a local call). It will connect if you leave off "020" but if you leave off the next digit too your call will fail to connect. Thought it may be useful to stop being being flummoxed by this. BTW, There are a fair number of major UK cities with area codes of 01?1. More info can be found here:

Title: Valid Formats
Name: Mike
Date: 12/21/2006 10:31:18 AM
For reference: Major cities are mostly of the form: 0131 123 1234 Other areas mostly: 01875 123 123 It is often valid to drop the 'area code' which is the first three of four digits. If the number is un-formatted, there is no simple way to tell whether the area code is four or five digits.

Title: Matts UK Telephone
Name: scamps
Date: 11/5/2005 9:23:21 AM
Works except for exception that exist in Camberley UK where, for some reason a local taxi firm, amongst others has a nnnnn nnnnn e.g 01276 66666 Thanks scamps

Copyright © 2001-2018, | ASP.NET Tutorials