views:

984

answers:

2

Well I have been asked to validate passport numbers (the documents used on airports to travel to other countries).

My question is: What format are these "numbers"? All I know is that they can have letters but I am not finding any place defining the rules. Any pointers/Links?

+5  A: 

I don't think you're going to be able to do this without restricting yourself to certain issuing countries. If you look at the specs of machine readable passports:

http://www.highprogrammer.com/alan/numbers/mrp.html

Is says that each country is free to use any format it likes for the actual passport number (including letters or digits). Although in the machine readable schema these seem to be limited to 9 characters (which might cause problems for countries with billions of citizens if they were to just use digits!)

UpTheCreek
+2  A: 

I would expect the format to depend on the issuing country.

UK passport numbers consist of 9 digits but used to consist of 6 digits and a letter.

Dave Hinton