BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   How to recognize mobile number in a given text? (http://www.blackberryforums.com/developer-forum/220388-how-recognize-mobile-number-given-text.html)

vivartpandey 02-23-2010 02:08 AM

How to recognize mobile number in a given text?
 
I want to extract valid(on the basis of format) mobile numbers from a text.

e.g. I/O some text (987) 456 7890, (987)-456-7890 again some text

O/P 9874567890 9874567890

problem is, there are many valid mobile formats in all over world like.

Code:

text = "Denmark 11 11 11 11, 1111 1111 "
        // + "Germany 03333 123456, +49 (3333) 123456 "
        // + "Netherlands + 31 44 12345678 Russia +7(555)123-123 "
        // + "spain 12-123-12-12 switzerland +41 11 222 22 22 "
        // + "Uk (01222) 333333 India +91-12345-12345 "
        // + "Austrailia (04) 1231 1231 USA (011) 154-123-4567 "
        // + "China 1234 5678 France    01-23-45-67-89 "
        // + "Poland (12) 345 67 89 Singapore 123 4567 "
        // + "Thailand  (01) 234-5678, (012) 34-5678 "
        // + "United Kingdom 0123 456 7890, 01234 567890 "
        // + "United States (987) 456 7890, (987)-456-7890+ etc."

How to cover all mobile formats?
min and max length of the mobile numbers(with or without country code)?
how to recognize that mobile number has country code or not?


All times are GMT -5. The time now is 11:34 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.