React开发(231):常见手机号邮箱的正则
生活随笔
收集整理的這篇文章主要介紹了
React开发(231):常见手机号邮箱的正则
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
// 手機號
const isPhone = /^1[3-9]\d{9}$/;
// const isPhone = /(\d{3}-|\d{4}-)?(\d{8}|\d{7})?/;// 郵箱
const isEmail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
// 密碼格式
const isPassword = /^[\w~`!@#$%^&*()-+=|\\<>,.?/\[\]{}:;'"]{6,16}$/;
// 身份證
const isIdentity = /^(([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4}(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9])|([3][0-1]))\d{3}[0-9xX]$/;
//港澳
const isHKCard = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/;
//臺
const isTWCard = /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/;
// 護照
const isPassPortCard = /^([a-zA-z]|[0-9]){5,17}$/;// 特殊字符
const specialcharactersReg = /^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/;
總結
以上是生活随笔為你收集整理的React开发(231):常见手机号邮箱的正则的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 聊聊Java反射
- 下一篇: 调整 Jupyter Notebook