获得匹配的字符串匹配到的所有分组

@param pattern 编译后的正则模式
@param content 被匹配的内容
@param withGroup0 是否包括分组0，此分组表示全匹配的信息
@return 匹配后得到的字符串数组，按照分组顺序依次列出，未匹配到返回空列表，任何一个参数为null返回null
@since 4.0.13
480847
public static List<String> getAllGroups(Pattern pattern, CharSequence content, boolean withGroup0) {
		if (null == content || null == pattern) {
			return null;
		}

		ArrayList<String> result = new ArrayList<>();
		final Matcher matcher = pattern.matcher(content);
		if (matcher.find()) {
			final int startGroup = withGroup0 ? 0 : 1;
			final int groupCount = matcher.groupCount();
			for (int i = startGroup; i <= groupCount; i++) {
				result.add(matcher.group(i));
			}
		}
		return result;
	}
356833
public static List<String> findAllGroup0(String regex, CharSequence content) {
		return findAll(regex, content, 0);
	}
1144824
public static int count(Pattern pattern, CharSequence content) {
		if (null == pattern || null == content) {
			return 0;
		}

		int count = 0;
		final Matcher matcher = pattern.matcher(content);
		while (matcher.find()) {
			count++;
		}

		return count;
	}
1058727
protected Pattern[] queryDetectionPattern(final Pattern... pattern) {
        if (pattern == null) {
            throw new IllegalArgumentException();
        } // end of if

        // ---

        if (this.queryDetection == null) {
            return pattern;
        } // end of if

        // ---

        final Pattern[] patterns = 
            new Pattern[this.queryDetection.length + pattern.length];

        System.arraycopy(this.queryDetection, 0, 
                         patterns, 0, 
                         this.queryDetection.length);

        int i = this.queryDetection.length;

        for (final Pattern p : pattern) {
            patterns[i++] = p;
        } // end of for

        return patterns;
    }
959180
public static List<String> findAllGroup1(String regex, CharSequence content) {
		return findAll(regex, content, 1);
	}
175770
public static List<String> match(String pattern, String reg, int group) {

        List<String> matchGroups = new ArrayList<>();
        Pattern compile = Pattern.compile(reg);
        Matcher matcher = compile.matcher(pattern);
        if (group > matcher.groupCount() || group < 0)
            throw new IllegalGroupIndexException("Illegal match group :" + group);
        while (matcher.find()) {
            matchGroups.add(matcher.group(group));
        }
        return matchGroups;
    }
1156889
public static String extractRegexGroup(String fromContent, String regex) throws Exception {
        return extractRegexGroup(fromContent, regex, 1);
    }
1136798
public static <T extends Collection<String>> T findAll(Pattern pattern, CharSequence content, int group, T collection) {
		if (null == pattern || null == content) {
			return null;
		}

		if (null == collection) {
			throw new NullPointerException("Null collection param provided!");
		}

		final Matcher matcher = pattern.matcher(content);
		while (matcher.find()) {
			collection.add(matcher.group(group));
		}
		return collection;
	}
10555
public static Token parse(final String pattern) {
		List<Token> tokens = new ArrayList<Token>();

		int start = 0;
		int count = 0;

		for (int i = 0; i < pattern.length(); ++i) {
			char character = pattern.charAt(i);

			if (character == '{') {
				if (count == 0) {
					if (start < i) {
						tokens.add(new PlainTextToken(pattern.substring(start, i)));
					}
					start = i;
				}
				count += 1;
			} else if (character == '}') {
				if (count == 0) {
					InternalLogger.log(Level.ERROR, "Opening curly bracket is missing: '" + pattern + "'");
				} else {
					count -= 1;
					if (count == 0) {
						tokens.add(parse(pattern.substring(start + 1, i)));
						start = i + 1;
					}
				}
			}
		}

		if (count > 0) {
			InternalLogger.log(Level.ERROR, "Closing curly bracket is missing: '" + pattern + "'");
		}

		int splitIndex = pattern.indexOf('|', start);
		if (splitIndex == -1) {
			tokens.add(createPlainToken(pattern.substring(start)));
			return tokens.size() == 1 ? tokens.get(0) : new BundleToken(tokens);
		} else {
			String token = pattern.substring(start, splitIndex).trim();
			tokens.add(createPlainToken(token));
			String[] styleOptions = SPLIT_PATTERN.split(pattern.substring(splitIndex + 1));
			return styleToken(tokens.size() == 1 ? tokens.get(0) : new BundleToken(tokens), styleOptions);
		}
	}
975277
@Nullable
    @Override
    public NodeGraphicDefinition getGroupGraphics(Object group, Set<String> groupElements) {
        return null;
    }
41165
public void setPattern(String pattern) throws IllegalArgumentException{
		if (pattern == null) {
			throw new IllegalArgumentException("The pattern must not be null.");
		}

		this.pattern = pattern;
		parsePattern(this.pattern);
	}
390351
public static boolean startsWithPattern(
      final byte[] byteArray,
      final byte[] pattern) {
    Preconditions.checkNotNull(byteArray);
    Preconditions.checkNotNull(pattern);
    if (pattern.length > byteArray.length) {
      return false;
    }

    for (int i = 0; i < pattern.length; ++i) {
      if (byteArray[i] != pattern[i]) {
        return false;
      }
    }

    return true;
  }
415688
protected XmlSchemaPatternFacet createPatternFacet(final String pattern) {
        XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet();
        xmlSchemaPatternFacet.setValue(pattern);
        return xmlSchemaPatternFacet;
    }
176792
public String getMatch(int groupnum) {
        if (groupnum == 0)
            return getMatch();
        else if (groupnum > groups.size())
            return null;

        return (String) groups.get(groupnum - 1);
    }
890617
public FulltextMatch setPatterns(
                    final Collection<String> patterns
                    )
    {
        if (patterns == null  ||  patterns.size() == 0) {
            clearPatterns();
            return this;
        }

        synchronized (patterns) {
            for (String  pattern : patterns) {
                if (pattern == null  ||  pattern.length() == 0) {
                    throw new IllegalArgumentException( "null element" );
                }
            }

            clearPatterns();
            for (String  pattern : patterns) {
                addPattern( pattern );
            }
        }

        return this;
    }
175928
public static boolean contains(String regex, CharSequence content) {
		if (null == regex || null == content) {
			return false;
		}

		final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
		return contains(pattern, content);
	}
392177
public Set<String> keys(String pattern){
		Set<String> keys = JedisProviderFactory.getMultiKeyCommands(groupName).keys(pattern);
		return keys;
	}