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