<?php
$text = "*After Cesar had reported this, he\r\n jumped into his UFO and flew to space*\r\nStory goes on ... with some text.\r\n*Another section with\r\na linefeed within asterisks*";
echo preg_replace_callback('~\*[^*]*\*~', function($x) { return str_replace(["\r","\n"], '', $x[0]); }, $text);
*After Cesar had reported this, he jumped into his UFO and flew to space*
Story goes on ... with some text.
*Another section witha linefeed within asterisks*
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
*After Cesar had reported this, he jumped into his UFO and flew to space*
Story goes on ... with some text.
*Another section witha linefeed within asterisks*