Title |
Test
Find
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:
Jeff Wain
|
Source |
CGRdevelopment's regex for NZ |
Your Rating |
|
Title: Thank you Jeff
Name: Sam
Date: 3/10/2022 10:03:33 PM
Comment:
Hi Jeff,
Thank you for this regex. It works perfectly. made a slight alteration to account for the 210 provider.
Expression: ^(((\+?64\s*[-\.\ ]?[3-9]|\(?0[3-9]\)?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?\d{4})|((\+?64\s*[-\.\(\ ]?2\d{1,2}[-\.\)\ ]?|\(?02\d{1}\)?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?\d{3,5})|((\+?64\s*[-\.\ ]?[-\.\(\ ]?800[-\.\)\ ]?|[-\.\(\ ]?0800[-\.\)\ ]?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?(\d{2}|\d{5})))|^$$
Title: Thank you Jeff
Name: Sam
Date: 3/10/2022 10:01:00 PM
Comment:
Hi Jeff,
Thank you for this regex. It works perfectly. made a slight alteration to account for the 210 provider.
Expression: ^(((\+?64\s*[-\.\ ]?[3-9]|\(?0[3-9]\)?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?\d{4})|((\+?64\s*[-\.\(\ ]?2\d{1,2}[-\.\)\ ]?|\(?02\d{1}\)?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?\d{3,5})|((\+?64\s*[-\.\ ]?[-\.\(\ ]?800[-\.\)\ ]?|[-\.\(\ ]?0800[-\.\)\ ]?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?(\d{2}|\d{5})))|^$$
Title: Thank you Jeff
Name: Sam
Date: 3/10/2022 10:00:37 PM
Comment:
Hi Jeff,
Thank you for this regex. It works perfectly. made a slight alteration to account for the 210 provider.
Expression: ^(((\+?64\s*[-\.\ ]?[3-9]|\(?0[3-9]\)?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?\d{4})|((\+?64\s*[-\.\(\ ]?2\d{1,2}[-\.\)\ ]?|\(?02\d{1}\)?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?\d{3,5})|((\+?64\s*[-\.\ ]?[-\.\(\ ]?800[-\.\)\ ]?|[-\.\(\ ]?0800[-\.\)\ ]?)\s*[-\.\ ]?\d{3}\s*[-\.\ ]?(\d{2}|\d{5})))|^$$
Title: Thank you
Name: chillybin
Date: 12/15/2014 10:50:18 PM
Comment:
First one I have found to work, thanks a lot.
Title: Thank you
Name: chillybin
Date: 12/15/2014 10:50:10 PM
Comment:
First one I have found to work, thanks a lot.