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

1967 posts

Uber Geek
+1 received by user: 1904


#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

1967 posts

Uber Geek
+1 received by user: 1904


  #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




nztim
4012 posts

Uber Geek
+1 received by user: 2710

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








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.