hooyes

中国身份证正则表达式

|2013-11-21

请尊重原创,本文原文地址:https://hooyes.net/p/regx-id-card

昨晚花了半小时,写了个验证中国身份证的正则表达式。目前觉得还是比较满意的。比较严谨,绝对原创。

^\d{6}(19|20)\d{2}([0][1-9]|11|12)([0,1,2][1-9]|[3][0,1])\d{3}([0-9]|X|x)$
$ welcome to hooyes.net
[INFO] ------------------------------o-
[INFO] Author : HOOYES
[INFO] Site : https://hooyes.net
[INFO] Page : https://hooyes.net/p/regx-id-card
[INFO] Last build : 2023-07-31 09:16:20 +0000
[INFO] -0------------------------------
原文地址:https://hooyes.net/p/regx-id-card
原文地址:https://hooyes.net/p/regx-id-card
Content
...
TOP