mysql queries data with valid ID number field value
仅有的幸福
仅有的幸福 2017-05-18 10:48:22
0
2
1056

Some values ​​in the ID number field in the table are invalid. How can I check the valid information for the ID number? Thanks

仅有的幸福
仅有的幸福

reply all(2)
伊谢尔伦

Regular expression:

ID card regex: d{6}(18|19|20)d{2}(0[1-9]|1[120])(0[1-9]|[12]d|3[01])d{3}(d|X)
Mysql regex:

select * 
from table 
where identity regexp '[[:digit:]]{6}(18|19|20)[[:digit:]]{2}(0[1-9]|1[120])(0[1-9]|[12][[:digit:]]|3[01])[[:digit:]]{3}([[:digit:]]|X)'
小葫芦

select * from 表 where list regexp '^[0-9]{18}$'

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!