protected function normalizeKey($cacheId)
    {
        $cacheId = parent::normalizeKey($cacheId);

        if (($pattern = $this->cache->getOptions()->getKeyPattern())
            && !preg_match($pattern, $cacheId)
        ) {
            $pattern = str_replace(array('^[', '*$'), array('[^', ''), $pattern);

            $cacheId = preg_replace($pattern, '_', $cacheId);
        }

        return $cacheId;
    }