3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '@mention_1 @$badmention Manual balls knit cardigan @120rb email me @ example@example.com'; $count = preg_match_all( '/(?:^|\s)@\K\w+/', $string, $matches ); var_export([ 'count' => $count, 'matches' => $matches[0] ]);

preferences:
24.13 ms | 405 KiB | 5 Q