public class RegexUtils extends Object
Constructor and Description |
---|
RegexUtils() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
getNamedCaptureGroupsFromPattern(String pattern)
Extracts the names of the named capture groups found within a regex.
|
public static Set<String> getNamedCaptureGroupsFromPattern(String pattern)
Matcher.group(String)
.
Derived from https://stackoverflow.com/questions/15588903/get-group-names-in-java-regex
The returned Set
preserves the order of capture groups as found in the pattern.pattern
- the pattern from which to extract the named capture groupsCopyright © 2021. All rights reserved.