fork download
  1. <?php
  2. $re = "/(?<=@)[^,]+/";
  3. $str = "Hello @bob, my name is @jack,";
  4. preg_match_all($re, $str, $matches);
  5. print_r($matches);
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => bob
            [1] => jack
        )

)