Skip to content

Instantly share code, notes, and snippets.

View FrankFan's full-sized avatar
🎯
Focusing

FrankFan FrankFan

🎯
Focusing
View GitHub Profile
@FrankFan
FrankFan / JS常用正则表达式.js
Last active October 20, 2020 02:32 — forked from JoeKeikun/JS常用正则表达式
JS常用正则表达式
/*
用途:检查输入的Email信箱格式是否正确
输入:strEmail:字符串
返回:如果通过验证返回true,否则返回false
*/
function checkEmail(strEmail)
{
//var emailReg = /^[_a-z0-9]+@([_a-z0-9]+\.)+[a-z0-9]{2,3}$/;
var emailReg = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
if ( emailReg.test(strEmail) ) {