I'm using this to replace $content if it contains @ sign at the beginning of the string. The code works outside Q2A.
$content = preg_replace("/^@([A-Za-z0-9_]*)/", "<a href=\"/user/$1\">@$1</a>", $content);
echo $content;
However, when using it in Q2A, nothing happens, no error reported, but the string $content is not replaced.
Example of a string:
$content = "@JoeBiden Hello boy! I'm a @tester.";
Funny enough, if I remove the ^ sign, the code works in Q2A, but it changes my purpose.
My PHP Version: 7.2