当前位置:网站首页>正则匹配邮箱
正则匹配邮箱
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>';
边栏推荐
- 牛客网 十进制整数转十六进制字符串
- P6698-[BalticOI 2020 Day2]病毒【AC自动机,dp,SPFA】
- eBanb B1手环刷固件异常中断处理
- Linux (centos7.9) installation and deployment of MySQL Cluster 7.6
- Essay - Reflection
- On the routing tree of gin
- 【Redis实现秒杀业务①】秒杀流程概述|基本业务实现
- 【输入法】迄今为止,居然有这么多汉字输入法!
- Niuke network decimal integer to hexadecimal string
- Code written by mysql, data addition, deletion, query and modification, etc
猜你喜欢
![[noi Simulation Competition] geiguo and time chicken (structure)](/img/4c/ed1b5bc2bed653c49b8b7922ce1674.png)
[noi Simulation Competition] geiguo and time chicken (structure)

The list of open source summer winners has been publicized, and the field of basic software has become a hot application this year

Squid proxy application

Ebanb B1 Bracelet brush firmware abnormal interrupt handling

深入了解 border
![[Niuke] convert string to integer](/img/56/3e491b3d0eea0d89a04d0b871501d7.png)
[Niuke] convert string to integer

Kaformer personal notes

4275. Dijkstra sequence

CDGA|到底怎么才能做好数据治理呢?

cookie加密 4 rpc方法确定cookie加密
随机推荐
The printed object is [object object]. Solution
[e325: attention] VIM editing error
Zero foundation self-study SQL course | syntax sequence and execution sequence of SQL statements
2020 China's provinces and cities, three-level linkage data, data agencies (data from the official website of the National Bureau of Statistics)
L01_ How is an SQL query executed?
Lu Qi: I am most optimistic about these four major technology trends
嵌入式 | 硬件转软件的几条建议
Longest public prefix of leetcode
[redis realize Secondary killing Business ①] Overview of Secondary killing Process | Basic Business Realization
Pytoch read data set (two modes: typical data set and user-defined data set)
Data middle office: overview of data governance
牛客网 十进制整数转十六进制字符串
Leetcode -- linked list
当程序员被问会不会修电脑时… | 每日趣闻
NETRCA: AN EFFECTIVE NETWORK FAULT CAUSE LOCALIZATION之论文阅读
Support vector machine (SVC, nusvc, linearsvc)
Time Series Data Augmentation for Deep Learning: A Survey 之论文阅读
怎么把mdf和ldf文件导入MySQL workbench中
从618看京东即时零售的野心
Leetcode -- wrong set