当前位置:网站首页>正则匹配邮箱
正则匹配邮箱
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>';
边栏推荐
- 零基础自学SQL课程 | 相关子查询
- PM2 deploy nuxt3 JS project
- Leetcode -- wrong set
- 深入了解 border
- 怎么把mdf和ldf文件导入MySQL workbench中
- Data middle office: a collection of middle office construction architectures of large domestic factories
- Weekly recommended short video: is the ultimate form of computing "meta universe"?
- Mba-day25 best value problem - application problem
- Cdga | how can we do well in data governance?
- The list of open source summer winners has been publicized, and the field of basic software has become a hot application this year
猜你喜欢
![[e325: attention] VIM editing error](/img/58/1207dec27b3df7dde19d03e9195a53.png)
[e325: attention] VIM editing error

零基础自学SQL课程 | HAVING子句

Inspiration from reading CVPR 2022 target detection paper
![[redis realize Secondary killing Business ①] Overview of Secondary killing Process | Basic Business Realization](/img/a3/9a50e83ece43904a3a622dcdb05b3c.png)
[redis realize Secondary killing Business ①] Overview of Secondary killing Process | Basic Business Realization
Depens:*** but it is not going to be installed
![[bug] @jsonformat has a problem that the date is less than one day when it is used](/img/09/516799972cd3c18795826199aabc9b.png)
[bug] @jsonformat has a problem that the date is less than one day when it is used

On the routing tree of gin

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

Mba-day25 best value problem - application problem

Squid代理服务器应用
随机推荐
[e325: attention] VIM editing error
1528. rearrange strings
零基础自学SQL课程 | HAVING子句
荐书丨《好奇心的秘密》:一个针尖上可以站多少跳舞的小天使?
Vidéo courte recommandée chaque semaine: Soyez sérieux en parlant de "métaunivers"
Weekly recommended short video: talk about "meta universe" with a serious attitude
Data middle office: overview of data governance
Framework tool class obtained by chance for self use
[redis implements seckill business ①] seckill process overview | basic business implementation
The border problem after the focus of input
Zero foundation self-study SQL course | having clause
Project deployment related
【输入法】迄今为止,居然有这么多汉字输入法!
十二、所有功能实现效果演示
每周推荐短视频:谈论“元宇宙”要有严肃认真的态度
Squid代理服务器应用
Essay - Reflection
4274. suffix expression
4275. Dijkstra sequence
活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热报名中