This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I need a regexp that can identify phone numbers based on how they are formated. They must be only digits, and can be formated like this: 12345678 123 45 678 12 34 56 78
I've created the following pattern that does this:
BUT: I've found one bug I don't know how to solve: If the user enters a phone number consisting of more than 8 digits after each other, my regexp picks up only the 8 first digits. I want the regexp to identify the phone number only if it's exactly 8 digits after each other.