Skip to content

Instantly share code, notes, and snippets.

@GithubMrxia
Created February 22, 2021 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GithubMrxia/b0a5458a040f6f8d91f1b81a9b434b3c to your computer and use it in GitHub Desktop.
Save GithubMrxia/b0a5458a040f6f8d91f1b81a9b434b3c to your computer and use it in GitHub Desktop.
常用正则表达式

类型|正则|备注 ---|---| 手机号| ^1\d{10}$ 座机号| 0\d{2,3}-\d{7,8}(-\d{1,6})? 身份证号| ^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|x|X)$ 两位小数 | ^\d+(\.\d{1,2})?$| 可以为整数 两位小数 | (^(\d{2,}|[1-9])+(\.\d{1,2})?$)|(^0\.((\d[1-9])|([1-9]0?))$) | 可以为整数,最小0.01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment