3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pattern = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/"; $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"; $replacement = "**************"; echo preg_replace($pattern, $replacement, "I want to replace this.is@an.email.address with stars");
based on mOhGf
Output for 4.3.11 - 5.6.28, 7.0.0 - 7.1.0
Warning: preg_replace(): No ending delimiter '^' found in /in/ev4qA on line 6
Output for hhvm-3.10.0 - 3.13.2
Warning: No ending delimiter '^' found: [^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$] in /in/ev4qA on line 6
Output for 4.3.0 - 4.3.10
Warning: No ending delimiter '^' found in /in/ev4qA on line 6