Not that you shouldn't necessarily use regular expressions here, but here is an alternative:
Given: $str = 'This is test @@test123@@';
$new_str = substr($str, strpos($str, "@@")+2, (strpos($str, "@@", $start))-(strpos($str, "@@")+2));
Or, same thing broken down:
$start = strpos($str, "@@")+2;
$end = strpos($str, "@@", $start);
$new_str = substr($str, $start, $end-$start);
Output:
echo $new_str; // test123