Replacing using backreferences
$members=<<<TEXT
Name E-Mail Address
------------------------------------------------
A i@example.com
D k@example.com
M m@example.org
B b@example.net
TEXT;
print preg_replace('/([^@\s]+)@(([-a-z0-9]+\.)+[a-z]{2,})/',
'\\1 at \\2', $members);
Related examples in the same category