unnested preg_replace from eval in wp-cli.php to avoid segfault

fixes #968