private function compareGroups($one, $two, $main)
{
// \ as separator has to be first
$one = str_replace('\\', ' ', $one);
$two = str_replace('\\', ' ', $two);
if ($main) {
if (strpos($one, $main) === 0 && strpos($two, $main) !== 0) {
return -1;
} elseif (strpos($one, $main) !== 0 && strpos($two, $main) === 0) {
return 1;
}
}
return strcasecmp($one, $two);
}