$str = '/category1/category2/page.html';
$parts = preg_split('/(?<=\w\/)(?=\w)/', $str, -1, PREG_SPLIT_NO_EMPTY);
for ($i = 1; $i < sizeof($parts); $i++) {
$parts[$i] = $parts[$i - 1] . $parts[$i];
}
if (preg_match('%^(\w+.*)/(\d+)-(\w+.*).html$%', $pathInfo, $matches)) {
$params['calias'] = $matches[1];
$params['id'] = $matches[2];
$params['alias'] = $matches[3];
}