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 New Zealand Phones
Expression
^(((\+?64\s*[-\.]?[3-9]|\(?0[3-9]\)?)\s*[-\.]?\d{3}\s*[-\.]?\d{4})|((\+?64\s*[-\.\(]?2\d{1}[-\.\)]?|\(?02\d{1}\)?)\s*[-\.]?\d{3}\s*[-\.]?\d{3,5})|((\+?64\s*[-\.]?[-\.\(]?800[-\.\)]?|[-\.\(]?0800[-\.\)]?)\s*[-\.]?\d{3}\s*[-\.]?(\d{2}|\d{5})))$
Description
This phone pattern matches all New Zealand phone numbers with formatting and returns a single formatted string as the first return in the array. Does not take into account all specific exclusions, though, in case of changes (like 025 to 027 in 2007). Based off of CGRdevelopment's New Zealand regex.
Matches
6402123456 | +64.800.12345678 | (03) 123 4567 | 021123456 | 027-123-456 | +64-027-123-123
Non-Matches
02.123.4567 | +64031234567 | 64.024.123.4567 | 800.123456
Author Rating: The rating for this expression. Jeff Wain
   Displaying page 1 of 1 pages; Items 1 to 1

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