- preg_match: documentation ( source)
<?php
$re = "/(?<=href=\"mailto:)(.*)?(?=\")/";
$value = "<p><a href=\"mailto:archivio.statociv@comune.padova.it\">archivio.statociv@comune.padova.it</a>, <strong>pec</strong> <a href=\"mailto:statocivile@comune.padova.legalmail.it\">statocivile@comune.padova.legalmail.it</a></p>";
if (preg_match($re, $value, $matches)) {
return $matches[1];
}
return 'no match';