- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$str = 'REXEL : Votre dossier Primexel n°@ref_dossier@ expire le @date_expiration@';
preg_match_all('/@([^@]+)@/i', $str, $matches, PREG_OFFSET_CAPTURE);
var_dump($matches);