Home >php教程 >php手册 >18位身份证正则

18位身份证正则

WBOY
WBOYOriginal
2016-06-07 11:37:511171browse

匹配18位身份证号码
$preg5 = '/^(1[1-5]{1}[0-2]{1}|2[1-3]{1}[0-2]{1}|3[0-2]{1}[0-1]{1})[0-9]{1}[0-8]{1}[0-9]{1}(19[0-9]{2}|200[0-9]{1}|201[0-5]{1})((01|03|05|07|08|10|12){0,1}(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1})|(04|06|09|11)(0[1-9]{1}|[1-2]{1}[0-9]{1}|30)|02(0[1-9]{1}|[1-2]{1}[0-9]{1}))[0-9]{3}[0-9xX]{1}$/'; 没有区分闰年 没有判断15位身份证号,有漏洞或者建议希望大家提出来,嘿嘿

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn