| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| public static final PatternWithGroups | EMPTY
The empty pattern that matches the null or empty string. |
| private static final int[] | |
| private static final PatternWithGroups. | |
| private final int[] | groupIndexes
The array of group indexes to capturing groups. |
| private final String | regex
The regular expression for matching and obtaining capturing group values. |
| private final Pattern | regexPattern
The compiled regular expression of |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | PatternWithGroups(final String
the regular expression. If the expression is regex)null or an empty string then the pattern will
only match
a null or empty string.Construct a new pattern. |
| public | PatternWithGroups(final String
the regular expression. If the expression is regex, final int[] null or an empty string then the
pattern
will only match a null or empty string.the array of group indexes to capturing groups. groupIndexes)Construct a new pattern. |
| public | PatternWithGroups(final Pattern
the regular expression pattern. regexPattern)Construct a new pattern. |
| public | PatternWithGroups(final Pattern
the regular expression pattern. regexPattern, final int[] the array of group indexes to capturing groups. groupIndexes)Construct a new pattern. |
| Modifier and Type | Method and Description |
|---|---|
| private static Pattern | |
| public final boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public final int[] | Returns: the group indexes to capturing groups.Get the group indexes to capturing groups. |
| public final String | |
| public final int | |
| public final MatchResult | Returns: the match result, otherwise null if no match occurs.the char sequence to match against the template. cs)Match against the pattern. |
| public final boolean | Returns: true if the char sequence matches the pattern, otherwise false.the char sequence to match against the template. cs, final List<String> the list to add the values of a pattern's capturing groups if matching is successful. The
values are
added in the same order as the pattern's capturing groups. The list is cleared before values
are added. groupValues)Match against the pattern. |
| public final boolean | Returns: true if the matches the pattern, otherwise false.the char sequence to match against the template. cs, final List<String> the list names associated with a pattern's capturing groups. The names MUST be in the same
order as the pattern's capturing groups and the size MUST be equal to or less than the number
of capturing groups. groupNames, final Map<String, String> the map to add the values of a pattern's capturing groups if matching is successful. A values
is put into the map using the group name associated with the capturing group. The map is
cleared before values are added. groupValues)Match against the pattern. |
| public final String |
| EMPTY | back to summary |
|---|---|
| public static final PatternWithGroups EMPTY The empty pattern that matches the null or empty string. | |
| EMPTY_INT_ARRAY | back to summary |
|---|---|
| private static final int[] EMPTY_INT_ARRAY | |
| EMPTY_STRING_MATCH_RESULT | back to summary |
|---|---|
| private static final PatternWithGroups. | |
| groupIndexes | back to summary |
|---|---|
| private final int[] groupIndexes The array of group indexes to capturing groups. | |
| regex | back to summary |
|---|---|
| private final String regex The regular expression for matching and obtaining capturing group values. | |
| regexPattern | back to summary |
|---|---|
| private final Pattern regexPattern The compiled regular expression of | |
| PatternWithGroups | back to summary |
|---|---|
| protected PatternWithGroups() Construct an empty pattern. | |
| PatternWithGroups | back to summary |
|---|---|
| public PatternWithGroups(final String regex) throws PatternSyntaxException Construct a new pattern.
| |
| PatternWithGroups | back to summary |
|---|---|
| public PatternWithGroups(final String regex, final int[] groupIndexes) throws PatternSyntaxException Construct a new pattern.
| |
| PatternWithGroups | back to summary |
|---|---|
| public PatternWithGroups(final Pattern regexPattern) throws IllegalArgumentException Construct a new pattern.
| |
| PatternWithGroups | back to summary |
|---|---|
| public PatternWithGroups(final Pattern regexPattern, final int[] groupIndexes) throws IllegalArgumentException Construct a new pattern.
| |
| compile | back to summary |
|---|---|
| private static Pattern compile(final String regex) throws PatternSyntaxException | |
| equals | back to summary |
|---|---|
| public final boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getGroupIndexes | back to summary |
|---|---|
| public final int[] getGroupIndexes() Get the group indexes to capturing groups. Any nested capturing groups will be ignored and the the group index will refer to the top-level capturing groups associated with the templates variables.
| |
| getRegex | back to summary |
|---|---|
| public final String getRegex() Get the regular expression.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| match | back to summary |
|---|---|
| public final MatchResult match(final CharSequence cs) Match against the pattern.
| |
| match | back to summary |
|---|---|
| public final boolean match(final CharSequence cs, final List<String> groupValues) throws IllegalArgumentException Match against the pattern. If a matched then the capturing group values (if any) will be added to a list passed in as parameter.
| |
| match | back to summary |
|---|---|
| public final boolean match(final CharSequence cs, final List<String> groupNames, final Map<String, String> groupValues) throws IllegalArgumentException Match against the pattern. If a matched then the capturing group values (if any) will be added to a list passed in as parameter.
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | end()
Implements java. Returns the offset after the last character matched. |
| public int | end(final int
The index of a capturing group in this matcher's pattern group)Implements java. Returns the offset after the last character of the subsequence captured by the given group during this match. |
| public String | group()
Implements java. Returns the input subsequence matched by the previous match. |
| public String | group(final int
The index of a capturing group in this matcher's pattern group)Implements java. Returns the input subsequence captured by the given group during the previous match operation. |
| public int | groupCount()
Implements java. Returns the number of capturing groups in this match result's pattern. |
| public int | |
| public int | start(final int
The index of a capturing group in this matcher's pattern group)Implements java. Returns the start index of the subsequence captured by the given group during this match. |
| EmptyStringMatchResult | back to summary |
|---|---|
| private EmptyStringMatchResult() | |
| end | back to summary |
|---|---|
| public int end() Implements java. Doc from java. Returns the offset after the last character matched.
| |
| end | back to summary |
|---|---|
| public int end(final int group) Implements java. Doc from java. Returns the offset after the last character of the subsequence captured by the given group during this match. Capturing groups are indexed from left
to right, starting at one. Group zero denotes the entire pattern, so
the expression m.
| |
| group | back to summary |
|---|---|
| public String group() Implements java. Doc from java. Returns the input subsequence matched by the previous match. For a matcher m with input sequence s,
the expressions m. Note that some patterns, for example | |
| group | back to summary |
|---|---|
| public String group(final int group) Implements java. Doc from java. Returns the input subsequence captured by the given group during the previous match operation. For a matcher m, input sequence s, and group index
g, the expressions m. Capturing groups are indexed from left
to right, starting at one. Group zero denotes the entire pattern, so
the expression If the match was successful but the group specified failed to match
any part of the input sequence, then | |
| groupCount | back to summary |
|---|---|
| public int groupCount() Implements java. Doc from java. Returns the number of capturing groups in this match result's pattern. Group zero denotes the entire pattern by convention. It is not included in this count. Any non-negative integer smaller than or equal to the value returned by this method is guaranteed to be a valid group index for this matcher.
| |
| start | back to summary |
|---|---|
| public int start() Implements java. Doc from java. Returns the start index of the match.
| |
| start | back to summary |
|---|---|
| public int start(final int group) Implements java. Doc from java. Returns the start index of the subsequence captured by the given group during this match. Capturing groups are indexed from left
to right, starting at one. Group zero denotes the entire pattern, so
the expression m.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final MatchResult |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | end()
Implements java. Returns the offset after the last character matched. |
| public int | end(final int
The index of a capturing group in this matcher's pattern group)Implements java. Returns the offset after the last character of the subsequence captured by the given group during this match. |
| public String | group()
Implements java. Returns the input subsequence matched by the previous match. |
| public String | group(final int
The index of a capturing group in this matcher's pattern group)Implements java. Returns the input subsequence captured by the given group during the previous match operation. |
| public int | groupCount()
Implements java. Returns the number of capturing groups in this match result's pattern. |
| public int | |
| public int | start(final int
The index of a capturing group in this matcher's pattern group)Implements java. Returns the start index of the subsequence captured by the given group during this match. |
| result | back to summary |
|---|---|
| private final MatchResult result | |
| GroupIndexMatchResult | back to summary |
|---|---|
| pack-priv GroupIndexMatchResult(final MatchResult r) | |
| end | back to summary |
|---|---|
| public int end() Implements java. Doc from java. Returns the offset after the last character matched.
| |
| end | back to summary |
|---|---|
| public int end(final int group) Implements java. Doc from java. Returns the offset after the last character of the subsequence captured by the given group during this match. Capturing groups are indexed from left
to right, starting at one. Group zero denotes the entire pattern, so
the expression m.
| |
| group | back to summary |
|---|---|
| public String group() Implements java. Doc from java. Returns the input subsequence matched by the previous match. For a matcher m with input sequence s,
the expressions m. Note that some patterns, for example | |
| group | back to summary |
|---|---|
| public String group(final int group) Implements java. Doc from java. Returns the input subsequence captured by the given group during the previous match operation. For a matcher m, input sequence s, and group index
g, the expressions m. Capturing groups are indexed from left
to right, starting at one. Group zero denotes the entire pattern, so
the expression If the match was successful but the group specified failed to match
any part of the input sequence, then | |
| groupCount | back to summary |
|---|---|
| public int groupCount() Implements java. Doc from java. Returns the number of capturing groups in this match result's pattern. Group zero denotes the entire pattern by convention. It is not included in this count. Any non-negative integer smaller than or equal to the value returned by this method is guaranteed to be a valid group index for this matcher.
| |
| start | back to summary |
|---|---|
| public int start() Implements java. Doc from java. Returns the start index of the match.
| |
| start | back to summary |
|---|---|
| public int start(final int group) Implements java. Doc from java. Returns the start index of the subsequence captured by the given group during this match. Capturing groups are indexed from left
to right, starting at one. Group zero denotes the entire pattern, so
the expression m.
| |