$re = '/\S+\@\S+/';
$str = 'From: Avanan
Sent: Thursday, December 5, 2024 2:39 PM
To: Support
Subject: Security event detected
Hello,
Please look at the details of the following anomaly event.
Details:
Dana@acme.com performed geo-suspicious events: logged in from United States (216.221.27.67) and after 1 minute logged in from United States (173.160.110.50)';
preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php