I need an example of how to validate an identification number in the Cuban identification card format. I'm looking for the regex validation in html5.
The format description:
Date of Birth (yymmdd) and 5 digits
There are 11 total digits.
Example: 89103024100
return false
//is not a leap yearreturn true
//a leap yearNote: this is uses rough date validation via pure RegEx (ie. any month can have up to 31 days):
You can test if a string matches via JavaScript like so:
If you need true date validation I would do something like the following:
And you can tack on the following for full id validation: