DD
DevDash

Regex for Australian Phone Number

Regex Pattern

^(?:\+61|0)4\d{8}$

Australian mobile number with optional +61 country code

Quick Answer

The regex pattern for australian phone number is `^(?:\+61|0)4\d{8}$`. Australian mobile number with optional +61 country code. This works in JavaScript, Python, Ruby, PHP, Java, and most regex engines that support PCRE syntax.

Test Examples

InputResult
+61412345678✓ Matches
0412345678✓ Matches
+61498765432✓ Matches
0312345678✗ No match
+61312345678✗ No match
12345678✗ No match

Code Examples

javascript

const regex = /^(?:\+61|0)4\d{8}$/;
const isValid = regex.test(value);

python

import re
pattern = r'^(?:\+61|0)4\d{8}$'
if re.match(pattern, value):
    print("valid")

ruby

pattern = /^(?:\+61|0)4\d{8}$/
if value =~ pattern
  puts "valid"
end

php

if (preg_match('/^(?:\+61|0)4\d{8}$/', $value)) {
    echo "valid";
}

java

String pattern = "^(?:\\+61|0)4\\d{8}$";
boolean isValid = value.matches(pattern);

Frequently Asked Questions

Related Regex Patterns

Want API access + no ads? Pro coming soon.