here is the fix

// Match ID
if (preg_match('/'.self::TOKEN_ID.'([a-zA-Z0-9_\\-]*)/', $sToParse, $aMatches))
$aAttributes['id'] = "'{$aMatches[1]}'";
// Match classes
if (preg_match_all('/\\'.self::TOKEN_CLASS.'([a-zA-Z0-9_\\-]*)/', $sToParse, $aMatches))
$aAttributes['class'] = '\''.implode(' ', $aMatches[1]).'\'';