Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}[\dXx]$
/

Description

身份证号(2代,18位数字),最后一位是校验位,可能为数字或字符X

Submitted by anonymous - 5 years ago