3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '#\d\s-\s\d#'; $string = '66 hello 2.3 - 44 world 99 -8 another dash - but no numbers'; echo preg_replace($regex, '-', $string);

preferences:
30.87 ms | 404 KiB | 5 Q