Description |
Matches the Common Name (CN) of the subject of a US Department of Defense (DoD) Common Access Card (CAC). In the plain-text part of the client certificate stored on a CAC, a subject, or the person named as the user of the certificate is represented by their Common Name. This regex identifies CNs and groups the parts that represent first and last name and the unique 10-digit identifying number at the end. I optionally matches the middle name or initial and ordinal (or generation) (II,III,IV, etc), if present.
It also accounts for both leading and trailing spaces as well as spaces and dashes within the name parts. It works for all common names I have ever had to deal with, though I do not know where the standard is stated to confirm compliance.
It is formatted for use specifically as validation, but could be modified for search. |