当前位置:网站首页>邮箱字符串判断
邮箱字符串判断
2022-04-23 05:53:00 【KK要继续努力】
邮箱字符串判断
题目:
判断输入是否是正确的邮箱格式,输出true表示格式正确
解答:
function isAvailableEmail(sEmail) {
//([\w+\.])+表示多个字母、下划线、数字、点
var reg = /^([\w+\.])+@\w+([.]\w+)+$/;
//或者
// /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
return reg.test(sEmail);
}
知识点:正则表达式、test()
版权声明
本文为[KK要继续努力]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_45393020/article/details/117991728
边栏推荐
猜你喜欢
[UDS unified diagnostic service] II. Network layer protocol (1) - overview and functions of network layer
[ThreadX] ThreadX source code reading plan (I)
FOC single resistance sampling position loop control servo motor
Assembler 32-bit unsigned addition calculator
2020 Jiangsu Collegiate Programming Contest-A.Array
基于VGG卷积神经网络的图像识别代码实现
cv_bridge 与opencv 版本不匹配的解决
微信小程序之点击取消,返回上页,修改上页的参数值,let pages=getCurrentPages() let prevPage=pages[pages.length - 2] // 上一页的数据
Detailed explanation and application of PN junction and diode principle
[UDS unified diagnostic service] IV. typical diagnostic service (2) - data transmission function unit
随机推荐
信息学一本通-小球
[UDS unified diagnosis service] i. diagnosis overview (2) - main diagnosis protocols (K-line and can)
Makefile foundation, common functions and general makefile
Collection of practical tips for C language (continuously updated)
Initialization of classes and objects (constructors and destructors)
copy constructor
赛氪-二进制
基于TensorFlow的线性回归实例
锚点定位——如何设置锚点居页面顶部距离,锚点定位并距离顶部一定偏移
sqlite编译
QT add qserialport class to realize serial port operation
C语言结构体指定初始化
cv_bridge 与opencv 版本不匹配的解决
查漏补缺(四)
Eigen 库常用基本用法 备忘
Round up a little detail of the round
C语言进阶要点笔记4
Latex configuration and use
Introduction to nonparametric camera distortion model
Makefile基础、常用函数及通用Makefile