protected function deduplicateCompressionPattern($matches, &$pattern)
    {
      $tmp_matches = $matches;
      
      $first_match = array_shift($tmp_matches);
      
      $differences = array();
      
      foreach ($tmp_matches as $some_match)
      {
        $differences += array_diff_assoc($first_match, $some_match);
      }
      
      $identical = array_diff_key($first_match, $differences);
      
      $prepared_matches = array();
      
      foreach ($matches as $i => $some_match)
      {
        $prepared_matches[self::COMPRESSION_PATTERN_START . implode(self::COMPRESSION_PATTERN_DELIMITER, array_diff_assoc($some_match, $identical))] = $i;
      }
      
      $pattern_parts = explode('(\d)', $pattern);
      
      foreach ($identical as $position => $value)
      {
        $pattern_parts[$position + 1] = $pattern_parts[$position] . $value . $pattern_parts[$position + 1];
        unset($pattern_parts[$position]);
      }
      
      $pattern = implode('(\d)', $pattern_parts);
      
      return $prepared_matches;
    }