3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = "michael@test.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 5cLPJ
Output for 4.3.0 - 7.2.0
array(3) { [0]=> string(16) "michael@test.com" [5]=> string(20) "dave@cheese.mansions" [9]=> string(26) "milkman@serverdouche.co.uk" }