当前位置:网站首页>正则匹配邮箱
正则匹配邮箱
2022-06-24 08:08:00 【BigChen_up】
//邮箱验证:
/** 目标满足的验证逻辑: @之前必须有内容且只能是字母(大小写)、数字、下划线(_)、减号(-)、点(.) @和最后一个.之间必须有内容且只能是字母(大小写)、数字、点(.)、减号(-),且两个点不能挨着 @最后一个.之后必须有内容且内容只能是字母(大小写)、数字且长度为大于等于2个字节,小于等于6个字节` 不满足校验逻辑: [email protected]…com [email protected],com [email protected] [email protected]?q?.com [email protected]@qq.com [email protected]@139.com [email protected]。com.cn [email protected])m [email protected]?£QQ.COM [email protected]___.com.cn [email protected]_163sadasdf.com.cn 满足逻辑的: [email protected] [email protected] [email protected] */
$pattern = '/^[\w-.][email protected][a-z\d-]+(\.[a-z\d-]+)*\.[a-z\d]{2,6}$/i';
$res = preg_match($pattern, $subject);
echo $res ? '是' : '非';
echo '<hr>';
边栏推荐
- 牛客网 十进制整数转十六进制字符串
- jupyter入门常见的几个坑:
- When programmers are asked if they can repair computers... | daily anecdotes
- From the Huawei weautomate digital robot forum, we can see the "new wisdom of government affairs" in the field of government and enterprises
- MYCAT read / write separation and MySQL master-slave synchronization
- MySQL data (Linux Environment) scheduled backup
- 每周推荐短视频:谈论“元宇宙”要有严肃认真的态度
- Depens:*** but it is not going to be installed
- 嵌入式 | 硬件转软件的几条建议
- 1528. rearrange strings
猜你喜欢

活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热报名中

When programmers are asked if they can repair computers... | daily anecdotes

Target detection series fast r-cnn

Squid proxy application

Time series data augmentation for deep learning: paper reading of a survey

Recommendation - Secret of curiosity: how many dancing angels can stand on the tip of a needle?

小白学习MySQL - 增量统计SQL的需求

当程序员被问会不会修电脑时… | 每日趣闻

【gdb调试工具】| 如何在多线程、多进程以及正在运行的程序下调试

Numpy numpy中的np.c_和np.r_详解
随机推荐
L01_一条SQL查询语句是如何执行的?
【Redis實現秒殺業務①】秒殺流程概述|基本業務實現
Data midrange: analysis of full stack technical architecture of data midrange, with industry solutions
Depens:*** but it is not going to be installed
Data midrange: detailed explanation of the technical stack of data acquisition and extraction
[Niuke] convert string to integer
Redis实现全局唯一ID
Zero foundation self-study SQL course | sub query
Framework tool class obtained by chance for self use
Alibaba Senior Software Testing Engineer recommends testers to learn -- Introduction to security testing
【输入法】迄今为止,居然有这么多汉字输入法!
Unable to change the virtual machine power status and report an error solution
小白学习MySQL - 增量统计SQL的需求
CF566E-Restoring Map【bitset】
Pytoch read data set (two modes: typical data set and user-defined data set)
[ES6 breakthrough] promise is comparable to native custom encapsulation (10000 words)
Threejs glow channel 01 (unrealbroompass & layers)
I heard that you are still spending money to buy ppt templates from the Internet?
Spark - the number of leftouterjoin results is inconsistent with that of the left table
2022.06.23 (traversal of lc_144,94145\