docs: function resolveSubPatterns (pattern) {
          if(!pattern) { return; }
  
          var expression  = pattern.expression;
          var subPatterns = expression.match(subPatternsRegex) || [];
  
          subPatterns.forEach(function (matched) {
              // matched is: %{subPatternName} or %{subPatternName:fieldName}
              var subPatternName = matched.substr(2, matched.length - 3);
  
              var elements   = subPatternName.split(':');
              subPatternName = elements[0];
              var fieldName  = elements[1];
  
              var subPattern = patterns.get(subPatternName);
              if (!subPattern) {
                  console.error('Error: pattern "' + subPatternName + '" not found!');
                  return;
              }
  
              if (!subPattern.resolved) {
                  resolvePattern(subPattern);
              }
  
              if (fieldName) {
                  expression = expression.replace(matched, '(?<' + fieldName + '>' + subPattern.resolved + ')');
              } else {
                  expression = expression.replace(matched, subPattern.resolved);
              }
          });
  
          pattern.resolved = expression;
          return pattern;
      }