-2

I have looked up patterns for the following: 1300, 1-300-, 1800, 1-800- followed by 10 digits and 13, 1-3- followed by 6 digits. They all look pretty long winded, was wondering if any one had any solutions using regular expressions only

ph1
  • 29
  • 3
  • 1
    [libphonenumber](https://code.google.com/p/libphonenumber/), [and these](http://stackoverflow.com/q/9412320/1079354) [two SO questions](http://stackoverflow.com/q/2555182/1079354)... – Makoto Aug 25 '13 at 16:53

1 Answers1

0

You can use the libphonenumber and let it take care of validation, formatting etc. Form their website

What is it?

Google's common Java, C++ and Javascript library for parsing, formatting, storing and validating international phone numbers. The Java version is optimized for running on smartphones, and is used by the Android framework since 4.0 (Ice Cream Sandwich).

Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
  • Thanks Pangea, but iam not sure i would be allowed to use this as it beyond the level we are at at the moment. I think we have to use regular expressons – ph1 Aug 25 '13 at 17:01