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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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