fork(1) download
  1. <?php
  2.  
  3. $data = "test test test test @brian_2 test test @john Spelling @test_3 test test test test";
  4.  
  5. preg_match_all("/@[a-z0-9_]+/",$data, $matches);
  6. print_r($matches);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => @brian_2
            [1] => @john
            [2] => @test_3
        )

)