Last active
July 27, 2017 12:28
-
-
Save zpf124/c6d8642a90adb741df2f55208893e920 to your computer and use it in GitHub Desktop.
正则表达式
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 16进制色+ RGB + RGBA 正则 | |
var colorRegExp = /^(#([0-9|a-f|A-F]{3}){1,2}|[rR][gG][Bb](\((\s*(2[0-4]\d|25[0-5]|[01]?\d{1,2})\s*,){2}\s*(2[0-4]\d|25[0-5]|[01]?\d{1,2})\s*\)|[Aa]\((\s*(2[0-4]\d|25[0-5]|[01]?\d{1,2})\s*,){3}\s*([01]|0\.\d*[1-9]\d*)\s*\)))$/; | |
// 简单的邮箱正则(只验证含有[email protected]) | |
var emailRegExp = /^[\w\.\-]+@([\w\-]+\.)+[\w\-]+$/; | |
// 手机号正则 校验 支持目前绝大部分手机号段 | |
var phoneRegExp = /^(13\d|14[57]|15[^4\D]|17[0135-8]|18\d)\d{8}$/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment