3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = "michaeltest.com dave@cheese.mansions milkman@serverdouche.co.uk"; $email = preg_grep("/[-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]+/", explode(' ', $input)); var_dump($email);
based on XmSgO
Output for 4.3.0 - 7.1.0
array(2) { [5]=> string(20) "dave@cheese.mansions" [9]=> string(26) "milkman@serverdouche.co.uk" }