protected function buildByMatch($item, $matches)
{
for ($nb = 1; $nb <= 3; $nb++) {
if (strpos($item, '$' . $nb) === false) {
continue;
}
$replace = isset($matches[$nb]) ? $matches[$nb] : '';
$item = trim(str_replace('$' . $nb, $replace, $item));
}
return $item;
}