private function _setupMemcacheKeyVariables($pattern) { preg_match_all('/\\{(\\w+)\\}/', $pattern, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); $variables = array(); foreach ($matches as $match) { $variableName = $match[1][0]; if (\array_key_exists($variableName, $variables)) { throw MemcacheCollectionException::duplicatePatternParameter($pattern, $variableName); } $variables[$variableName] = array('pattern' => $match[0][0], 'replace_string' => $match[0][0], 'start_offset' => $match[0][1]); } return $variables; }