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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find South African Landline numbers
Expression
^(?:(?:\(|)0|\+27|27)(?:1[12345678]|2[123478]|3[1234569]|4[\d]|5[134678])(?:\) | |-|)\d{3}(?: |-|)\d{4}$
Description
Limited by proper dialing codes as per http://en.wikipedia.org/wiki/Telephone_numbers_in_South_Africa. It will match phone numbers in most common formats that users normally type their phone number. Tested with Perl engine regex in PHP.
Matches
+27121234567 +2712 123 4567 012 123 4567 (012) 123 4567 (012) 123-4567
Non-Matches
27621234567
Author Rating: The rating for this expression. Ian van den Heuvel
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

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

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