.+);VerHw:(?.+);VerPl:(?[^;\n]+)(?:(;HostSrv:.+)?;VerMCD:(?.+))?/', $poll_device['sysDescr'], $matches)) { $hardware = 'MiVoice ' . str_replace(' ICP', '', $matches['hw1']) . ' ' . $matches['hw2']; // Convert to MCD version (see: http://www.prairiefyre.com/kb/KnowledgebaseArticle51645.aspx) $mcd = explode('.', $matches['version']); // Examples: "13.0.1.53" >> "MCD 7.0 SP1 (Build: 13.0.1.53)" // "13.0.1.53" >> "MCD 3.0 (Build: 9.0.0.41)" $version = 'MCD ' . ($mcd[0] - 6) . '.' . $mcd[1] . ($mcd[2] > 0 ? ' SP' . $mcd[2] : '') . ' (Build: ' . $matches['version'] . ')'; //if (isset($matches['mcd'])) { $version = 'MCD '.$matches['mcd'].' (Build: '.$matches['version'].')'; } } unset($matches, $mcd); // EOF