code: function generateIntermetiateElementRegex(i, forceOptional) {
            var charRegex;
            try {
              var element = maskWithoutOptionals[i];
              var elementRegex = patterns[element];
              var hasOptional = isOptional(i);
  
              if (elementRegex) {
                charRegex = '(' + elementRegex.source + ')';
              } else { // is a divisor
                if (!isDivisor(i)) {
                  divisors.push(i);
                  divisorElements[i] = element;
                }
  
                charRegex = '(' + '\\' + element + ')';
              }
            } catch (e) {
              throw e;
            }
  
            if (hasOptional || forceOptional) {
              charRegex += '?';
            }
  
            return new RegExp(charRegex);
          }
docs: REGEX