Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


cddt

1496 posts

Uber Geek


#317763 13-Nov-2024 08:53
Send private message

I have been asked to prepare a script to validate the formatting of NZ phone numbers. For landline and mobile it's pretty easy, but for toll and toll-free numbers I am not familiar with which prefixes are still in use (e.g. 0800, 0900, 0508), or how many digits the following part can be (5 - 8 digits?)

 

I'm sure I see 0800 around, but not sure about 0900 or 0508. Likewise I'm not sure I've seen a 5-digit number following... 

 

So my naive crack at a regex would be ^0(508|800|900)\s[0-9]{5,8}$ 

 

If anyone is a real subject matter expert, let me know about Australian toll and toll-free numbers too. :D 





My referral links: BigPipeMercury


Create new topic
cddt

1496 posts

Uber Geek


  #3308407 13-Nov-2024 09:36
Send private message

So I checked Wikipedia and it suggested that "Toll-free numbers begin with 0508 or 0800,[4] followed by usually six but sometimes seven digits"

 

But the link to NAD then says that free-phone numbers should be 10 digits, meaning the prefix is follow by six, so not sure where the "sometimes seven" came from. 

 

Likewise the information on premium-rate numbers is inconsistent. 

 

I'm only looking for best effort accuracy here, not to cover off all the edge cases! 





My referral links: BigPipeMercury


 
 
 

Move to New Zealand's best fibre broadband service (affiliate link). Note that to use Quic Broadband you must be comfortable with configuring your own router.
nztim
3745 posts

Uber Geek

ID Verified
Trusted
TEAMnetwork
Subscriber

  #3308439 13-Nov-2024 10:33
Send private message

Our 0800 TEAMNET number is 0800 832 6638 but in reality, if you dial 0800 832 663 it will work the and if you dial with the 8 just the telco drops the 8 and connects the call





Any views expressed on these forums are my own and don't necessarily reflect those of my employer. 


Create new topic





News and reviews »

Māori Artists Launch Design Collection with Cricut ahead of Matariki Day
Posted 15-Jun-2025 11:19


LG Launches Upgraded webOS Hub With Advanced AI
Posted 15-Jun-2025 11:13


One NZ Satellite IoT goes live for customers
Posted 15-Jun-2025 11:10


Bolt Launches in New Zealand
Posted 11-Jun-2025 00:00


Suunto Run Review
Posted 10-Jun-2025 10:44


Freeview Satellite TV Brings HD Viewing to More New Zealanders
Posted 5-Jun-2025 11:50


HP OmniBook Ultra Flip 14-inch Review
Posted 3-Jun-2025 14:40


Flip Phones Are Back as HMD Reimagines an Iconic Style
Posted 30-May-2025 17:06


Hundreds of School Students Receive Laptops Through Spark Partnership With Quadrent's Green Lease
Posted 30-May-2025 16:57


AI Report Reveals Trust Is Key to Unlocking Its Potential in Aotearoa
Posted 30-May-2025 16:55


Galaxy Tab S10 FE Series Brings Intelligent Experiences to the Forefront with Premium, Versatile Design
Posted 30-May-2025 16:14


New OPPO Watch X2 Launches in New Zealand
Posted 29-May-2025 16:08


Synology Premiers a New Lineup of Advanced Data Management Solutions
Posted 29-May-2025 16:04


Dyson Launches Its Slimmest Vaccum Cleaner PencilVac
Posted 29-May-2025 15:50


OPPO Reno13 Pro 5G Review 
Posted 29-May-2025 15:33









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.