Collection of commonly used regular expressions

  1. License plate number restrictions:

^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$
  1. Determine whether the ID card is legitimate

(\\d{17}[0-9a-zA-Z])|(\\d{14}[0-9a-zA-Z])
  1. Used to extract the birthday from the ID card

\\d{6}([12][0-9]\\d{2}[01][0-9][123][0-9]).*
  1. Used to obtain specific year, month and day information

(\\d{4})(\\d{2})(\\d{2})

Guess you like

Origin blog.csdn.net/zjb1697922408/article/details/128966062