GithubHelp home page GithubHelp logo

userfulregularexpression's Introduction

Userful RegEx

常用的正则表达式

匹配手机号

  • Regex: ^1[3,8]\d{9}|14[5,7,9]\d{8}|15[^4]\d{8}|17[^2,4,9]\d{8}$

  • 说明

移动号段:
135、136、137、138、139、147、150、151、152、157、158、159、178、182、183、184、187、188
联通号段:
130、131、132、145、155、156、175、176、185、186
电信号段:
133、1349[3]、149、153、173、177、180、181、189
虚拟号段:
1700、1701、1702、1703、1704、1705、1706、1707、1708、1709、171

匹配IP

  • Regex:((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)

匹配大于8个字符且首字符为大写字母的密码

  • Regex: ^[A-Z]\w{7,}$

匹配身份证

  • Regex: ^[1-6]\d{16}X|[1-6]\d{17}$

  • 前六位为地区代码,中间八位为出生年月,最后四位为分配顺序代码

  • 匹配18位/17位+X 身份证号码最后一位是校验码,X表示的是10

  • 该表达式只是大概匹配(因为全国的县实在太多了,而且不规则 :( ) 最新全国区县代码

userfulregularexpression's People

Contributors

fengzhihao123 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.