RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 17 regular expressions found.

   Displaying page 1 of 1 pages; Items 1 to 17
Title Test Details Pattern Title
Expression
(\s*\(?0\d{4}\)?\s*\d{6}\s*)|(\s*\(?0\d{3}\)?\s*\d{3}\s*\d{4}\s*)
Description
UK Phone Number Allows leading and trailing spaces and optional spaces after the dialing code. Initially the expression I posted was \s*0\d{4}\s*\d{6}\s*|\s*0\d{3}\s*\d{7}\s* But this didn't include optional brackets e.g. (01603) 123123 or phone numbers in a London format e.g. 0208 123 1234
Matches
01603 123123 | 0207 1234567 | (0208) 123 1234
Non-Matches
123 123132
Author Rating: Not yet rated. Joe Gass
Title Test Details Pattern Title
Expression
^\s*\(?(020[7,8]{1}\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\s*$
Description
Matches UK phone numbers - London and regional. It started off with something fairly short posted by liljim at www.forums.devshed.com but I wanted a little more precision to weed out all the zeros. Now it also weeds out premium phone numbers (as of 19/12/03).
Matches
02071111111 | 01000100000
Non-Matches
00000000000
Author Rating: Not yet rated. M h
Title Test Details UK Phone Number
Expression
^((\(?0\d{4}\)?\s?\d{3}\s?\d{3})|(\(?0\d{3}\)?\s?\d{3}\s?\d{4})|(\(?0\d{2}\)?\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$
Description
UK phone number. Allows 3, 4 or 5 digit regional prefix, with 8, 7 or 6 digit phone number respectively, plus optional 3 or 4 digit extension number prefixed with a # symbol. Also allows optional brackets surrounding the regional prefix and optional spaces between appropriate groups of numbers.
Matches
01222 555 555 | (010) 55555555 #2222 | 0122 555 5555#222
Non-Matches
01222 555 5555 | (010) 55555555 #22 | 0122 5555 5555#222
Author Rating: Not yet rated. Amos Hurd
Title Test Details Modified UK Phone Number
Expression
^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$
Description
Modified version of UK phone number regular expression. Now allows +44 national code in addition to extension numbers of 3 or 4 digits. Previous expression was: ^((\(?0\d{4}\)?\s?\d{3}\s?\d{3})|(\(?0\d{3}\)?\s?\d{3}\s?\d{4})|(\(?0\d{2}\)?\s?\d{4}\s?\d{4}))(\s?#(\d{4}|\d{3}))?$
Matches
+447222555555 | +44 7222 555 555 | (0722) 5555555 #2222
Non-Matches
(+447222)555555 | +44(7222)555555 | (0722) 5555555 #22
Author Rating: The rating for this expression. Amos Hurd
Title Test Details UK Phone # with International option
Expression
^\s*\(?((\+0?44)?\)?[ \-]?(\(0\))|0)((20[7,8]{1}\)?[ \-]?[1-9]{1}[0-9]{2}[ \-]?[0-9]{4})|([1-8]{1}[0-9]{3}\)?[ \-]?[1-9]{1}[0-9]{2}[ \-]?[0-9]{3}))\s*$
Description
UK phone number formats with optional international prefix, optional spaces, dashes and brackets. Brackets mandatory for regional/capital leading zero if included in international form. Based on "Mh" UK London & Regional. (Thanks Mh for the groundwork). New to Regex so I'm sure it can be done more elegantly... but it works.
Matches
0208-123-4567 | 01234-567890 | (01234) 567890 | +44 (0)1234 567890 | +044(0)1234567890
Non-Matches
208-123-4567 | 012345-67890 | (1234) 567890 | 44 (0)1234 567890 | +034(0)1234567890
Author Rating: The rating for this expression. Andrew McCormick
Title Test Details UK Telephone
Expression
(((\+44)? ?(\(0\))? ?)|(0))( ?[0-9]{3,4}){3}
Description
This regex matches UK phone numbers in multiple formats, including those that begin with the international dial code and optionally bracket the leading zero of the area code. To match a number must begin with either +44 or 0 and have 9-12 following digits.
Matches
+44 (0) 1234 567890 or +44 1234 567890 or 01234 567890 or 0123 456 7890
Non-Matches
Numbers not beginning with 0 or +44 and numbers with less than 9 digits
Author Rating: Not yet rated. VB
Title Test Details UK Phone with country code and area code
Expression
\+44\s\(0\)\s\d{2}\s\d{4}\s\d{4}
Description
Simple expression to validate a UK phone number including country code and area code. Requires spacing.
Matches
+44 (0) 55 4444 3333
Non-Matches
+44 (0) 5555555555 | 55 4444 3333
Author Rating: Not yet rated. Suriya Supatanasakul
Title Test Details UK Phone Number in 4-3-4 Format
Expression
^[\d]{4}[-\s]{1}[\d]{3}[-\s]{1}[\d]{4}$
Description
Allows dashes or spaces to separate.
Matches
0800 333 4444 | 0870-333-4444 | 0844 333-4444
Non-Matches
08003334444 | 0800=333=4444 | 0800 333 4444
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-3-3 Format
Expression
^[\d]{5}[-\s]{1}[\d]{3}[-\s]{1}[\d]{3}$
Description
Allows dashes or spaces to separate.
Matches
08000 333 333 | 08700-333-333 | 08440 333-333
Non-Matches
08000333333 | 08000=333=333 | 08000 333 333
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-2-2-2 Format
Expression
^[\d]{5}[-\s]{1}[\d]{2}[-\s]{1}[\d]{2}[-\s]{1}[\d]{2}$
Description
Allows dashes or spaces to separate.
Matches
08000 22 22 22 | 08700-22-22-22 | 08440 22-22-22
Non-Matches
08000222222 | 08000=22=22=22 | 08000 22 22 22
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-4-2 Format
Expression
^[\d]{5}[-\s]{1}[\d]{4}[-\s]{1}[\d]{2}$
Description
Allows dashes or spaces to separate.
Matches
0800 4444 22 | 0870-4444-22 | 0844 4444-22
Non-Matches
0800444422 | 0800=4444=22 | 0800 4444 22
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Phone Number in 5-2-4 Format
Expression
^[\d]{5}[-\s]{1}[\d]{2}[-\s]{1}[\d]{4}$
Description
Allows dashes or spaces to separate.
Matches
0800 22 4444 | 0870-22-4444 | 0844 22-4444
Non-Matches
0800224444 | 0800=22=4444 | 0800 22 4444
Author Rating: Not yet rated. Matthew Harris
Title Test Details UK Telephone Numbers
Expression
((\+44\s?\(0\)\s?\d{2,4})|(\+44\s?(01|02|03|07|08)\d{2,3})|(\+44\s?(1|2|3|7|8)\d{2,3})|(\(\+44\)\s?\d{3,4})|(\(\d{5}\))|((01|02|03|07|08)\d{2,3})|(\d{5}))(\s|-|.)(((\d{3,4})(\s|-)(\d{3,4}))|((\d{6,7})))
Description
Matches over 18 different combinations for UK phone numbers that I could find. If there are any errors please get in touch.
Matches
0121 111 1111|+44 (0)21 444 4444|07941 111 111|07941 111111|(+44) 121 222 3333
Non-Matches
0121_111_3333
Author Rating: The rating for this expression. Darren Moore
Title Test Details UK Phone Number
Expression
^((\+44\s?\d{4}|\(?\d{5}\)?)\s?\d{6})|((\+44\s?|0)7\d{3}\s?\d{6})$
Description
Allows both mobile and landline UK Telephone Numbers. Allows either Brackets or international prefix. Allows spaces after international prefix and regional code. No brackets for mobile numbers. Please report any problems. Thanks
Matches
01902123456 | 01902 123456 | (01902)123456 | (01902) 123456 | +441902123456 | +441902 123456 | +44 1902123456 | +44 1902 123456 | 07807123456 | 07807 123456 | +447807123456 | +447807 123456 | +44 7807123456 | +44 7807 123456
Non-Matches
11902123456 | (+441902)123456 | 441902123456 | (078)07123456
Author Rating: Not yet rated. Jay Anslow
Title Test Details UK Phone Number
Expression
^(((\+44\s?|0044\s?)?|(\(?0))((2[03489]\)?\s?\d{4}\s?\d{4})|(1[23456789]1\)?\s?\d{3}\s?\d{4})|(1[23456789][234578][0234679]\)?\s?\d{6})|(1[2579][0245][0467]\)?\s?\d{5})|(11[345678]\)?\s?\d{3}\s?\d{4})|(1[35679][234689]\s?[46789][234567]\)?\s?\d{4,5})|([389]\d{2}\s?\d{3}\s?\d{4})|([57][0-9]\s?\d{4}\s?\d{4})|(500\s?\d{6})|(7[456789]\d{2}\s?\d{6})))$
Description
UK phone number for both Geographic (landline) and Non-Geographic (Cell) numbering. It validates a complete range of combination of area code, location and formate , it also allows international number starting from +44 or 0044 and it also allows () with area code and spaces.
Matches
+44 20 xxxx xxxx | 0044 20 xxxx xxxx | 020 xxxx xxxx | (020) xxxx xxxx | (020)xxxxxxx |020 xxxx xxxxx | (01xxx) xxxxxx | (01xxx) xxxxx | (01x1) xxx xxxx | (011x) xxx xxxx | (02x) xxxx xxxx | (01xxxx) xxxxx and (01xxxx) xxxx | 05x xxxx xxxx | 03xx xxx xxxx | 07xxx xxxxxx | 08xx xxx xxxx and 09xx xxx xxxx
Non-Matches
+44 020 xxxx xxxx | +44 (20) xxxx xxxx
Author Rating: The rating for this expression. Masood Ahmed Panezai
Title Test Details Match UK telephone number in any format.
Expression
^\(?(?:(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?\(?(?:0\)?[\s-]?\(?)?|0)(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}|\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4}|\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3})|\d{5}\)?[\s-]?\d{4,5}|8(?:00[\s-]?11[\s-]?11|45[\s-]?46[\s-]?4\d))(?:(?:[\s-]?(?:x|ext\.?\s?|\#)\d+)?)$
Description
Step 1: Test that the input is a UK phone number. Later patterns extract the prefix, NSN and extension, and further tests check the NSN for length and validity. The above pattern matches optional opening parentheses, followed by 00 or 011 and optional closing parentheses, followed by an optional space or hyphen, followed by optional opening parentheses. Alternatively, the opening parentheses are followed by a literal + without a following space or hyphen. Any of the previous options are then followed by 44 with optional closing parentheses, followed by optional space or hyphen, followed by optional 0 in optional parentheses, followed by optional space or hyphen, followed by optional opening parentheses (international format). Alternatively, the pattern matches optional opening parentheses followed by the 0 trunk code (national format). This is followed by the area code and phone number in 2+8, 3+7, 3+6, 4+6, 4+5, 5+5 or 5+4 format with or without spaces and/or hyphens. This also includes provision for optional closing parentheses and/or optional space or hyphen after where the user thinks the area code ends and the local number begins. The pattern allows any format to be used with any UK number. The display format must be corrected by later logic if the wrong format for this number has been used by the user on input. The pattern finally ends with optional space or hyphen followed by x, ext and optional period, or #, followed by a three or four digit extension number. Once the input has been confirmed as being a telephone number using the above pattern, another RegEx pattern should extract prefix, NSN and extension and then the NSN should be further tested for length and validity. (Order fixed for even greater efficiency: shorter area codes match first.)
Matches
020 3000 5555, (020) 3000 5555, +44 20 3000 5555, 00 44 20 3000 5555, 011 44 20 3000 5555, 0203 000 5555, 02030 005 555, (+44) 20 3000 5555, (+44 20) 3000 5555, and many others, any with NSN of 10 or 9.
Non-Matches
01750 5555, 0203 5555 7777, +33 1 2345 6789
Author Rating: The rating for this expression. g1smd
Title Test Details UK Telephone Numbers
Expression
^(((\+|00)?44|0)([123578]{1}))(((\d{1}\s?\d{4}|\d{2}\s?\d{3})\s?\d{4})|(\d{3}\s?\d{2,3}\s?\d{3})|(\d{4}\s?\d{4,5}))$
Description
Validates UK phone numbers based on the Wikipedia page http://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom including the international dialing code 0044/+44/44
Matches
0XX XXXX XXXX | 0XXX XXX XXXX | 0XXXX XXXXXX
Non-Matches
04XXX XXXXXX | 06XXX XXXXXX | 0XXXXXXX
Author Rating: Not yet rated. Paul Verhulpen
   Displaying page 1 of 1 pages; Items 1 to 17

Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials