<?php$re = "/(?<=@)[^,]+/"; $str = "Hello @bob, my name is @jack,"; preg_match_all($re, $str, $matches);print_r($matches);
Standard input is empty
Array ( [0] => Array ( [0] => bob [1] => jack ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!