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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Phone Numbers: Australian
Expression
^(\+\d{2}[ \-]{0,1}){0,1}(((\({0,1}[ \-]{0,1})0{0,1}\){0,1}[2|3|7|8]{1}\){0,1}[ \-]*(\d{4}[ \-]{0,1}\d{4}))|(1[ \-]{0,1}(300|800|900|902)[ \-]{0,1}((\d{6})|(\d{3}[ \-]{0,1}\d{3})))|(13[ \-]{0,1}([\d \-]{5})|((\({0,1}[ \-]{0,1})0{0,1}\){0,1}4{1}[\d \-]{8,10})))$
Description
Intended to validate Australian Phone Numbers. Very loosely based on Bill Hely's regex, but allows for further options for Country code, (un)bracketed Area code, spaced/hyphenated 8-digit/ Mobile/1X00*/13*.
Matches
+61 02 9123 1234 | +61 3 8123 1234 | +61 7 9123 1234 | +61-04-9123-1234 | +61-2-9123-1234 | +61-8-9123-1234 | +61-7-9123-1234 | +61-(03)-9123-1234 | +61 (03) 9123-1234 | 02 9123 1234 | 03-9123-1234 | (03) 9123 1234 | (07) 9123 1234 | (03) 9123-1234 | 1900-123-322 | 1900 322 232 | 1900322132 | 1902222032 | 1800-132 322 | 1 800 322 222 | 1300232322 | 13 73 23 | 132 221 | 0400 111 222 | 0400111222 | +61 400 111 222 | +61 (0)3 1234 4566 | +61 (0)411222333 | +61 (0)400-000-000
Non-Matches
+61-05-9123-1234 | +61-6-9123-1234 | 19021234567
Author Rating: The rating for this expression. ptooey
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

Title: Issue on validation
Name: Dilrukshan
Date: 8/26/2013 7:10:13 AM
Comment:
When I enter the following two phone numbers One provides success and the other return validation error. what probably may be causing this behaviour? Validation Fail 145523235 165236345 Validation Pass 245523235 263496523


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