Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!usc!rutgers!texbell!vector!telecom-gateway From: tanner@ki4pv.uucp (Dr. T. Andrews) Newsgroups: comp.dcom.telecom Subject: Re: Parsing Dialed Digits Message-ID: Date: 22 Oct 89 12:04:58 GMT Sender: news@vector.Dallas.TX.US Organization: CompuData, Inc. (DeLand) Lines: 19 Approved: telecom-request@vector.dallas.tx.us X-Submissions-To: telecom@eecs.nwu.edu X-Administrivia-To: telecom-request@vector.dallas.tx.us X-TELECOM-Digest: volume 9, issue 470, message 7 of 8 )> How can I tell whether to take the next two or the next three )> digits as the country code ? ) It depends on the first two digits. ) If the first two digits are a valid country code, then you do not have ) to look at the third digit. Sorry, this doesn't work. Some country codes (mainly for toy countries) are special cases of others. Consider "countries" like the Vatican (looks like a particular exchange in Rome Italy) or San Marino. You have to examine rather a lot of digits to decide whether the call is to Rome Italy or the Vatican. I believe that the list of country codes posted here some time ago also listed several French-speaking island countries as having country codes which started with the French 2 digits and were followed by another digit or two to specify the country. ...!bikini.cis.ufl.edu!ki4pv!tanner ...!bpa!cdin-1!ki4pv!tanner or... {allegra attctc gatech!uflorida uunet!cdin-1}!ki4pv!tanner