search
HomeBackend DevelopmentPHP Tutorial求高难度正则解决方法

求高难度正则
一段话,如:
@abc falieurisdlfalsjdfj Email: [email protected] alkjdiruasjdflasdfj @abc.uk salkdjfoawuierj @123,lskdufasjidfja

上面这段话中 [email protected] 和 @abc.uk [email protected] 而不要取出 [email protected] @abc.cn 就像微博中一样 @符号后面,逗号或者句号前面的内容取出来,[email protected]




------解决方案--------------------

PHP code
$s = <font color="#e78608">------解决方案--------------------</font><br>田心老师的没有考虑到  [email protected]<br>刚学习正则,来个。<br><br>
PHP code
<?php $str = "@abc falieurisdlfalsjdfj Email: [email&#160;protected] alkjdiruasjdflasdfj @abc.uk salkdjfoawuierj @123,lskdufasjidfja";preg_match_all("/(^|\s *)@([\w.]+)/is",$str,$arr);print_r($arr);<div class="clear">
                 
              
              
        
            
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python如何使用email、smtplib、poplib、imaplib模块收发邮件Python如何使用email、smtplib、poplib、imaplib模块收发邮件May 16, 2023 pm 11:44 PM

一封电子邮件的旅程是:MUA:MailUserAgent&mdash;&mdash;邮件用户代理。(即类似Outlook的电子邮件软件)MTA:MailTransferAgent&mdash;&mdash;邮件传输代理,就是那些Email服务提供商,比如网易、新浪等等。MDA:MailDeliveryAgent&mdash;&mdash;邮件投递代理。Email服务提供商的某个服务器发件人->MUA->MTA->MTA->若

在Java中,我们可以将顶级类声明为protected或private吗?在Java中,我们可以将顶级类声明为protected或private吗?Sep 12, 2023 pm 07:21 PM

不,我们不能将顶级类声明为私有或受保护。它可以是公共或默认(无修饰符)。如果没有修饰符,则应该具有默认访问权限。语法//Atoplevelclass&nbsp;&nbsp;publicclassTopLevelClassTest{&nbsp;&nbsp;&nbsp;//Classbody}如果将一个顶级类声明为私有(private),编译器将会报错,提示“在此处不允许使用修饰符private”。这意味着顶级类不能是私有的,同样也适用于protected访问

ABC是什么币?ABC是什么币?Feb 25, 2024 am 08:04 AM

ABC是什么币?在数字货币领域,ABC代币是一种普遍存在的数字资产,具有独特的特性和广泛的应用。这种代币通常由项目或网络发行,通过ICO或其他方式进行分发。ABC代币通常具备特定的功能和用途,能够在特定平台或生态系统中发挥作用。ABC代币的功能和用途ABC代币的功能和用途因项目而异,这取决于发行方的设定和目标。有些ABC代币被设计用于在特定生态系统内进行支付,并赋予持有者特定权益或权限。其他ABC代币可能用于激励用户参与平台的活动,如提供内容、分享数据或参与治理决策。这样的代币可以被视为一种激励

Java程序展示不同的访问级别Java程序展示不同的访问级别Aug 19, 2023 pm 10:09 PM

Accessmodifiersareusedtosetthefeatureofvisibilityofsomeparticularclasses,interfaces,variables,methods,constructors,datamembers,andthesettermethodsinJavaprogramminglanguage.在Java环境中,我们有不同类型的访问修饰符。默认-如果我们声明一个函数,它只会在特定的包中可见。Private-如果我们声明一个函数,它只能在特定的类中可

win10邮箱如何插入附件教程win10邮箱如何插入附件教程Jan 07, 2024 pm 12:14 PM

很多用户在日常生活中都需要发送邮件来进行工作,有些更是需要附加各种插件资料进行交流,那么该怎么插入附件呢?下面就一起来看看详细的教程吧。win10邮箱如何插入附件:1、打开邮箱2、点击左上角的“新邮件”图标3、点击右上角“插入”4、点击右上角“附件”5、选择需要的“附件”6、完成即可

Yii框架中的Email:实现邮件发送Yii框架中的Email:实现邮件发送Jun 21, 2023 am 08:49 AM

Yii框架是一个高性能、开源的Web开发框架,它具有高效的路由和模块化机制,非常适合快速开发复杂的Web应用程序。其中,发送邮件是任何一个应用程序都不可避免的功能之一。在Yii框架中,实现邮件发送非常简单,并且还提供了许多自定义选项,以及丰富的业务逻辑支持。一、Yii框架中的邮件配置在Yii框架中,配置文件是非常重要的资源,用于配置应用程序的基本信息和各种组

springboot hutool整合email的方法是什么springboot hutool整合email的方法是什么May 11, 2023 pm 12:55 PM

内容介绍本文介绍两种方式发送email文件springboot整合email发送文件springboot利用hutool整合email发送文件前提发送email文件需要开启popspringboot整合email发送文件导入依赖org.springframework.bootspring-boot-starter-mail配置文件spring:mail:default-encoding:utf-8host:smtp.aliyun.comusername:邮箱账号password:密码发送邮件测试

Oprah Winfrey interviews AI technology leaders and public in ABC broadcast titled AI and the Future of UsOprah Winfrey interviews AI technology leaders and public in ABC broadcast titled AI and the Future of UsSep 18, 2024 pm 01:07 PM

Oprah Winfrey interviewed AI technology leaders and the public in an hour-long ABC broadcast titled AI and the Future of Us. The show was created to help the public better understand the benefits and threats of current and emerging AI. The luminaries

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)