code: public NamedPatternMatch<E> match(final String string) {
          final Matcher matcher = pattern.matcher(string);
          while (matcher.find()) {
  
              final int start = matcher.start();
              final int end = matcher.end();
  
              if (start == 0 && end == string.length()) {
                  final Map<E, String> resultMap = new EnumMap<>(groupEnum);
                  final Set<Entry<E, Integer>> entries = groupIndexes.entrySet();
                  for (final Entry<E, Integer> entry : entries) {
                      final E group = entry.getKey();
                      final Integer groupIndex = entry.getValue();
                      final String result = matcher.group(groupIndex);
                      resultMap.put(group, result);
                  }
                  return new NamedPatternMatch<>(resultMap);
              }
          }
  
          return null;
      }
docs: Matches a string against this named pattern.
  
  @param string
  the string to match
  @return a match object, or null if there was no match