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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(^1300\d{6}$)|(^1800|1900|1902\d{6}$)|(^0[2|3|7|8]{1}[0-9]{8}$)|(^13\d{4}$)|(^04\d{2,3}\d{6}$)
Description
Australian phone numbers: Matches all known formats incl normal 10-digit landline numbers (valid area code mandatory) 13, 1300, 1800, 1900, 1902 plus mobile 10 and 11-digit formats. Use a Replace function first to remove non-numerics which are probably separators (E.g. newNum = number.replace(/[\D]/g, ""). Please contact me if you find any valid Aussie numbers being rejected.
Matches
0732105432 | 1300333444 | 131313
Non-Matches
32105432 | 13000456
Author Rating: The rating for this expression. Bill Hely
Source Bill Hely (bill.hely@technology.cc)
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: hh
Name: hh
Date: 11/21/2017 4:49:54 AM
Comment:
941348626


Title: Validation not working
Name: spwebanu@gmail.com
Date: 8/14/2014 3:53:03 AM
Comment:
Hello i am getting problem with this validation when i enter 61403169498 this number i get message enter valid mobile number. please help me.


Title: why?
Name: Nico
Date: 6/7/2012 3:25:58 AM
Comment:
Why use something like ^0[2|3|7|8]{1} when you can use ^0[2378] ? Also why use ^04\d{2,3}\d{6}$ when you can use ^04\d{8,9}$ ?


Title: Mr
Name: Loz
Date: 1/11/2011 8:07:18 PM
Comment:
is there a way to use this for data type: integer in infopath. Want to be able for user to input contact number and use regex to match it


Title: there are errors in this format
Name: vj
Date: 5/26/2008 12:28:44 AM
Comment:
it does not work for number starts from 1800, 1900. i changed the part to (^1800\d{6}|1900\d{6}|1902\d{6}$) thanks


Title: there are errors in this format
Name: vj
Date: 5/26/2008 12:27:45 AM
Comment:
it does not work for number starts from 1800, 1900. i changed the part to (^1800\d{6}|1900\d{6}|1902\d{6}$) thanks


Title: Internalional Format Australian Numbers
Name: Lloyd Borrett
Date: 2/2/2006 11:15:55 PM
Comment:
This expression doesn't handle international format numbers like 61359049005 or 61418170044, which are valid Australian phone numbers. There are also 7 digit 1800 numbers not passed, plus 01 servies numbers not passed. Try something like: // // Function to check an Australian phone number is valid. // function is_valid_phone ($strPhone) { $isValid = false; // Strip blanks, brackets, periods, dashes and plus $strPhone = str_replace(array('(', ')', '-', '+', '.', ' '), '', $strPhone); // Check 10 or 11 digits switch (strlen($strPhone)) { case "6": if (ereg('^(13[0-9]{4})$', $strPhone)) { $isValid = true; } break; case "7": if (ereg('^(180[0-9]{4})$', $strPhone)) { $isValid = true; } break; case "10": if (ereg('^(((01|02|03|04|07|08|12|19)[0-9]{8})|(1300[0-9]{6})|(180[0-9]{7}))$', $strPhone)) { $isValid = true; } break; case "11": if (ereg('^(61(1|2|3|4|7|8)[0-9]{8})$', $strPhone)) { $isValid = true;


Title: Parse Error in ASP.Net
Name: Jodda
Date: 7/23/2004 6:30:39 AM
Comment:
Too many )'s.


Title: prob with 1800|1900|1902
Name: Mal
Date: 9/15/2003 11:10:40 PM
Comment:
I couldn't get validations to work with 1800 and 1900 numbers - worked fine with 1902 though... I fixed it by separating the the 1800|1900|1902 block but is probably not the ideal solution: (^1300\d{6}$)|(^1800\d{6}$)|(^1900\d{6}$)|(^1902\d{6}$)|(^0[2|3|7|8]{1}[0-9]{8}$)|(^13\d{4}$)|(^04\d{2,3}\d{6}$)


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