A
A
and7ey2012-02-18 14:02:03
Regular Expressions
and7ey, 2012-02-18 14:02:03

Regular expression to validate a series of soviet and russian passport at the same time?

In fact, there are two questions in one - what could a series of Soviet passports look like and how to check it? The user can enter in the field a series of both a Soviet passport and a Russian one.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Skpd, 2012-02-18
@Skpd

Regarding the Soviet passport:
otvety.google.ru/otvety/thread?tid=7c171e25e79fc216
The series of the Soviet passport of the 1974 model consists of Roman numerals (from I to XXXIII) and two capital letters. The figures reflect the sequence in which passports were issued. The letters are the region code. Each region has its own code. In Moscow, for example, these are MJ and SB, in the Krasnodar Territory - AG and TM, in the Kirov Region - IR, etc. This does not mean that Muscovites cannot have Kirov passports and vice versa (the migration factor must be taken into account), but if all of a sudden the Kirov or Krasnodar series appear in the Moscow subscription lists, this should alert the controller.
All USSR passport numbers are in the range of 500,000-750,000. If you come across a passport with other numbers, this is either a typo or an outright fake. The line is rejected in any case, and the signature sheets of this collector are subject to biased verification.

S
Skpd, 2012-02-18
@Skpd

The regular can be like this:
(?:[IVX]{2}|[0-9]{2})[0-9]{2}[\s\-](?:[AZ]{2}| [0-9]{3}\s*[0-9]{3})
Or this:
(?:[IVX]{2}[0-9]{2}\-[AZ]{2} |[0-9]{4}\s*[0-9]{3}\s*[0-9]{3})
Wrote on my knee, need to check =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question