• Welcome to the eight year blog, I'm glad to meet you at the right age!
  • Due to the theme, QQ login partners will display the default avatar in the comments. Please go to the personal center and upload the avatar again.

The regular expressions I used in those years

Code Notes barben First 12 months (17-12 months) 381 views 0 comments
Can only be numbers and commas /^[\d,]*$/
Verification of mobile phone basic number /^1[345789]\d{9}$/
Enter multiple mobile phone numbers. Each mobile phone number is separated by a comma. Commas cannot appear at the beginning and end /^(1(3|4|5|7|8)\d{9})(,(1(3|4|5|7|8)\d{9}))*$/
The length of the password is 6-18 bits, and there are at least two kinds of numbers, letters and symbols /(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^[^\s\u4e00-\u9fa5]{6,18}$/
The verification URL must start with lowercase HTTP or HTTPS /(http|https):\/\/([\w.]+\/?)\S*/
It doesn't matter if you verify the correct URL with or without HTTP or HTTPS /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/|www\.)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/
Verify that the ID card number is correct (must meet 18 digits, and the date of birth must be correct) /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/
Check whether the minimum amount is correct /^(([^0][0-9]+|0)\.([0-9]{1,2})$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]{1,2})$)|^(([1-9]+)$)/

Eight blogs that year, we've been there all the time
If the author does not indicate the original article, please indicate the link and source of this article
Regular expressions I used in those years - https://www.barben.cn/code/655.html
Like it( eleven )
Post my comments
Cancel comment
expression Mapping Bold Strikethrough Center Italics

You need to bring your nickname and email with you in the year of eight!

  • Nickname (required)
  • Email address (required)
  • website