Regular Expressions 101

Community Patterns

extract mailto: mail address from link (<a>) tags

0

Regular Expression
PCRE (PHP <7.3)

%
<a[\s\S]*? \bhref="(mailto:(.*?))"[\s\S]*?>(.*?)</a>
%
gm

Description

MATCH ANY YOUTUBE ID

author : Michael CAILLET mi-ca v1.0 – 2017.08.13 This Regex match any mailto attribute and retrieve the [0]=>mailto link , [1]=>email address , [2]=>tag content

Submitted by Michael CAILLET - 7 years ago