Php Regex/preg_match-获取字符串和电子邮件地址之间的文本

Php Regex/preg_match-获取字符串和电子邮件地址之间的文本,php,regex,preg-match,Php,Regex,Preg Match,我正在从电子邮件中提取数据。我有这样几段文字: Eg. 1: some standard text. Bugs Bunny bugs@gmail.com 0411111111 more standard text Eg. 2: some standard text. Bugs The Bunny bugs@gmail.com 0411111111 more standard text Eg. 3: some standard text. Bugs Bunny bugs.bunny@

我正在从电子邮件中提取数据。我有这样几段文字:

Eg. 1: some standard text.   Bugs Bunny bugs@gmail.com 0411111111 more standard text 
Eg. 2: some standard text.   Bugs The Bunny bugs@gmail.com 0411111111 more standard text
Eg. 3: some standard text.   Bugs Bunny bugs.bunny@gmail.com 0411111111 more standard text
Eg. 4: some standard text.   Bugs bugs.bunny@gmail.com +6141 111 111 more standard text
正如你所看到的,有一个名字,电子邮件和电话号码,我想提取。 电子邮件应该很简单,我相信我可以计算出电话选项,但我如何才能得到名字

我知道逻辑是:在
一些标准文本之后获取文本。
@
之前获取第一个非空格分隔字符串,但是如何获取呢


这是我的出发点。
(?这里是我想到的一个快速版本/示例:

(?<=some standard text. )(.*?) ([^\s]+@[^\s]+) (\+?\d+(?:\s\d+)*) 

(?我写了这篇文章,你可以在上面测试它:


1.你说的
完全匹配是什么意思?2.然后
一些标准文本。
总是一样的,并且总是以点结尾。下面是我想到的一个快速版本/示例:
(?@addons_zz-我刚刚在小组方面进行了自我教育,所以我将稍微编辑一下这个问题。@JonathanKuhn-喜欢!请将其作为答案发布,我会接受它。
(?x) # Here we are entering the the free space mode

# Here we assure the spaces are not matched by the `[\w ]+` group
(?:\.\s+)

# Here we are matching for the guys name, before its email address
([\w ]+(?:\w+))\s+

# Here we match the email
(\w[^\s]+@[^\s]+)\s+

# Here  we match the telephone number
(\+?[\d ]+)(?!\w)