3v4l.org

run code in 300+ PHP versions simultaneously
<?php $email = 'delboy1978uk@work.com'; $regex = '#\w+@(?<domain>\w+\-?\w+\.\w+)#'; preg_match($regex, $email, $matches); $domain = $matches['domain']; if ($domain !== 'example-test.com') { echo 'domain '.$domain.' doesnt match'; }

preferences:
32.47 ms | 404 KiB | 5 Q