private function getDigitPattern()
    {
        if (!isset($this->digitPattern)) {
            $lengths = array_map('strlen', $this->digits->getDigits());

            if (count(array_flip($lengths)) === 1) {
                $this->digitPattern = array_pop($lengths);
            } else {
                $this->digitPattern = sprintf(
                    '(%s|.+)s%s',
                    implode('|', array_map('preg_quote', $this->digits->getDigits())),
                    $this->digits->isCaseSensitive() ? '' : 'i'
                );
            }
        }

        return $this->digitPattern;
    }