Nrapendra Sharma wrote:i need to detect country mainly.
is there any standard implementation which can be refered for creating a phone parser ..??
I think you could use a list of dialing codes -
http://en.wikipedia.org/wiki/List_of_country_calling_codes
See how the codes are not overlapping. eg. if Egypt is +20, there's no country with +20x
So you could put these codes in a map (code -> country), then check the first digit. If that matches a code, then that's the country. If it does not, take the second digit to get a two digit code and see if that's in the map. I don't think that's most elegant, but maybe better than getting a list of regular expressions if all you're trying to do is detect country.