3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = " title-one author-two date-three who-author- "; echo preg_replace("/^author-.*$/", "", $string); echo preg_replace('/^author\-.*/im', '', $string);

preferences:
44.89 ms | 402 KiB | 5 Q