\[(?<id>id(?<idNumber>.*?))\|(?<notify>@(?<name>.*?))\]
Group `id` id296954377
Group `idNumber` 296954377
Group `notify` @wert43211
Group `name` wert43211
$re = '/\[(?<id>id(?<idNumber>.*?))\|(?<notify>@(?<name>.*?))\]/m';
$str = '[id296954377|@wert43211]';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);