src/MvcCore/Ext/Debugs/Tracys/RoutingPanel.php
protected function completeFormatedPatternCharGroups ($str, $brackets) {
		$matches = $this->completeMatchingBracketsPositions($str, $brackets[0], $brackets[1]);
		if ($matches) {
			$pos = 0;
			$result = '';
			foreach ($matches as $key => & $match) {
				list($subStr, $begin, $end) = $match;
				$result .= mb_substr($str, $pos, $begin - $pos);
				$result .= '<span class="c'.($key % 6).'">';
				$result .= htmlSpecialChars($subStr, ENT_NOQUOTES, 'UTF-8');
				$result .= '</span>';
				$pos = $end + 1;
			}
			$result .= mb_substr($str, $pos);
		} else {
			$result = $str;
		}
		return $result;
	}
protected function completeFormatedPatternCharGroups ($str, $brackets) {
		$matches = $this->completeMatchingBracketsPositions($str, $brackets[0], $brackets[1]);
		if ($matches) {
			$pos = 0;
			$result = '';
			foreach ($matches as $key => & $match) {
				list($subStr, $begin, $end) = $match;
				$result .= mb_substr($str, $pos, $begin - $pos);
				$result .= '<span class="c'.($key % 6).'">';
				$result .= htmlSpecialChars($subStr, ENT_NOQUOTES, 'UTF-8');
				$result .= '</span>';
				$pos = $end + 1;
			}
			$result .= mb_substr($str, $pos);
		} else {
			$result = $str;
		}
		return $result;
	}
Add into route regular expression pattern or reverse ($route->GetPattern()
or $route->GetReverse()) around all detected character groups special
html span elements to color them in template.
@param string   $str	  route pattern string or reverse string
@param string[] $brackets array with specified opening bracket and closing bracket type
@return string