Home > database >  Verify whether the string contains the id number
Verify whether the string contains the id number

Time:10-02

As title, mysql to verify whether the string contains the correct id number,
Such as "so-and-so id number * * * * * * * * * * * * * * * * * * * * *"

CodePudding user response:

Write a Boolean function
The first layer is a regular expression said 17 consecutive Numbers, because someone and the last is said to be the X
Before the second six have table available, but no table can skip
7 ~ 10 years, generally is the first 1 or 2, then 11 can only be 0 or 1, 11 is 1 when the 12 is only 0 1 2
13 is only 0 1 2 3, if it is 3, then 14 only 0 or 1
Can also add a option in February, leap year can also add

Any a layer of expression to false returns false

CodePudding user response:

Search online
Id number is composed of 18 digit: before six for the administrative region division code, 7 to 14 for birth date code, for the order of 15 to 17 yards, 18th to check code,
Old resident identity card number is 15 digits, 2000 years later, the original 7, 8 year Numbers instead of full name, and in the last increase the check code, a resident identity card number of the warp knitting is not for change, the police will give you add in the account information, when you want to change a new id card is the 18 id number,
  • Related