Uses of Class
com.google.mu.util.Substring.Pattern
Package
Description
A few useful collections.
StringFormat, Substring, Optionals and more...
-
Uses of Substring.Pattern in com.google.mu.collect
Modifier and TypeMethodDescriptionstatic Selection.Parser
Selection.delimitedBy
(Substring.Pattern delimiter) Returns a parser forSelection
, using thedelimiter
patter to delimit explicit selection elements. -
Uses of Substring.Pattern in com.google.mu.util
Modifier and TypeClassDescriptionstatic final class
An immutable string prefixPattern
with extra utilities such asSubstring.Prefix.addToIfAbsent(String)
,Substring.Prefix.removeFrom(StringBuilder)
,Substring.Prefix.isIn(CharSequence)
etc.static final class
An immutable string suffixPattern
with extra utilities such asSubstring.Suffix.addToIfAbsent(String)
,Substring.Suffix.removeFrom(StringBuilder)
,Substring.Suffix.isIn(CharSequence)
etc.Modifier and TypeFieldDescriptionstatic final Substring.Pattern
Substring.BEGINNING
Pattern
that matches the empty substring at the beginning of the input string.static final Substring.Pattern
Substring.END
Pattern
that matches the empty substring at the end of the input string.static final Substring.Pattern
Substring.NONE
Pattern
that never matches any substring.Modifier and TypeMethodDescriptionstatic Substring.Pattern
Substring.after
(Substring.Pattern delimiter) Returns aPattern
that covers the substring afterdelimiter
.static Substring.Pattern
Substring.before
(Substring.Pattern delimiter) Returns aPattern
that covers the substring beforedelimiter
.static Substring.Pattern
Substring.between
(char open, char close) Returns aPattern
that will match the substring between the firstopen
and the firstclose
after it.static Substring.Pattern
Substring.between
(char open, Substring.BoundStyle openBound, char close, Substring.BoundStyle closeBound) Similar toSubstring.between(char, char)
but allows to use alternative bound styles to include or exclude the delimiters at both ends.static Substring.Pattern
Substring.between
(Substring.Pattern open, Substring.BoundStyle openBound, Substring.Pattern close, Substring.BoundStyle closeBound) Similar toSubstring.between(Pattern, Pattern)
but allows to use alternative bound styles to include or exclude the delimiters at both ends.static Substring.Pattern
Substring.between
(Substring.Pattern open, Substring.Pattern close) Returns aPattern
that will match the substring betweenopen
andclose
.static Substring.Pattern
Substring.between
(String open, Substring.BoundStyle openBound, String close, Substring.BoundStyle closeBound) Similar toSubstring.between(String, String)
but allows to use alternative bound styles to include or exclude the delimiters at both ends.static Substring.Pattern
Returns aPattern
that will match the substring between the firstopen
and the firstclose
after it.static Substring.Pattern
Substring.consecutive
(CharPredicate matcher) Returns aPattern
that matches the first non-empty sequence of consecutive characters identified bymatcher
.static Substring.Pattern
Substring.first
(char character) Returns aPattern
that matches the first occurrence ofcharacter
.static Substring.Pattern
Substring.first
(CharPredicate charMatcher) Returns aPattern
that matches the first character found bycharMatcher
.static Substring.Pattern
Returns aPattern
that matches the first occurrence ofstr
.static Substring.Pattern
Returns aPattern
that matches the first occurrence ofregexPattern
.static Substring.Pattern
Returns aPattern
that matches the first occurrence ofregexPattern
and then selects the capturing group identified bygroup
.final Substring.Pattern
Substring.Pattern.followedBy
(String lookahead) Returns an otherwise equivalent pattern except it requires the matched substring be immediately followed by thelookahead
string.final Substring.Pattern
Substring.Pattern.immediatelyBetween
(String lookbehind, Substring.BoundStyle lookbehindBound, String lookahead, Substring.BoundStyle lookaheadBound) Similar toimmediatelyBetween(String, String)
, but allows including thelookbehind
and/orlookahead
inclusive in the match.final Substring.Pattern
Substring.Pattern.immediatelyBetween
(String lookbehind, String lookahead) Returns an otherwise equivalent pattern except it requires the matched substring be immediately preceded by thelookbehind
string and immediately followed by theafter
string.static Substring.Pattern
Substring.last
(char character) Returns aPattern
that matches the last occurrence ofcharacter
.static Substring.Pattern
Substring.last
(CharPredicate charMatcher) Returns aPattern
that matches the last character found bycharMatcher
.static Substring.Pattern
Returns aPattern
that matches the last occurrence ofstr
.static Substring.Pattern
Substring.leading
(CharPredicate matcher) Returns aPattern
that matches from the beginning of the input string, a non-empty sequence of leading characters identified bymatcher
.Substring.Pattern.limit
(int maxChars) Returns aPattern
that's equivalent to this pattern except it only matches at mostmaxChars
.final Substring.Pattern
Substring.Pattern.notFollowedBy
(String lookahead) Returns an otherwise equivalent pattern except it requires the matched substring not be immediately followed by thelookahead
string.final Substring.Pattern
Substring.Pattern.notImmediatelyBetween
(String lookbehind, String lookahead) Returns an otherwise equivalent pattern except it requires the matched substring not be immediately preceded by thelookbehind
string and immediately followed by theafter
string.final Substring.Pattern
Substring.Pattern.notPrecededBy
(String lookbehind) Returns an otherwise equivalent pattern except it requires the matched substring not be immediately preceded by thelookbehind
string.final Substring.Pattern
Substring.Pattern.or
(Substring.Pattern that) Returns aPattern
that falls back to usingthat
ifthis
fails to match.Substring.Pattern.peek
(Substring.Pattern following) Return aPattern
equivalent to thisPattern
, except it will fail to match if thefollowing
pattern can't find a match in the substring after the current match.final Substring.Pattern
Substring.Pattern.precededBy
(String lookbehind) Returns an otherwise equivalent pattern except it requires the matched substring be immediately preceded by thelookahead
string.final Substring.Pattern
Substring.Pattern.separatedBy
(CharPredicate separator) Returns an otherwise equivalentPattern
, except it only matches if it's next to the beginning of the string, the end of the string, or theseparator
character(s).Substring.Pattern.separatedBy
(CharPredicate separatorBefore, CharPredicate separatorAfter) Returns an otherwise equivalentPattern
, except it requires the beginning of the match must either be the beginning of the string, or be separated from the rest of the string by theseparatorBefore
character; and the end of the match must either be the end of the string, or be separated from the rest of the string by theseparatorAfter
character.Substring.Pattern.skip
(int fromBeginning, int fromEnd) Returns aPattern
that's equivalent to this pattern except it will skip up tofromBeginnings
characters from the beginning of the match and up tofromEnd
characters from the end of the match.static Substring.Pattern
Returns aSubstring.Pattern
spanning the substring matchingformat
.static Substring.Pattern
Substring.spanningInOrder
(String stop1, String stop2, String... moreStops) Returns aPattern
that matches the first occurrence ofstop1
, followed by an occurrence ofstop2
, followed sequentially by occurrences ofmoreStops
in order, including any characters between consecutive stops.final Substring.Pattern
Substring.Pattern.then
(Substring.Pattern following) Similar to regex lookahead, returns a pattern that matches thefollowing
pattern after it has matched this pattern.final Substring.Pattern
Substring.Pattern.toEnd()
Returns aPattern
that will match from the substring matched bythis
to the end of the input string.static Substring.Pattern
Substring.trailing
(CharPredicate matcher) Returns aPattern
that matches from the end of the input string, a non-empty sequence of trailing characters identified bymatcher
.static Substring.Pattern
Substring.upToIncluding
(Substring.Pattern pattern) Returns aPattern
that will match from the beginning of the original string up to the substring matched bypattern
inclusively.static Substring.Pattern
Substring.word()
Returns aPattern
that matches the first occurrence of a word composed of[a-zA-Z0-9_]
characters.static Substring.Pattern
Returns aPattern
that matches the first occurrence ofword
that isn't immediately preceded or followed by another "word" ([a-zA-Z0-9_]
) character.Modifier and TypeMethodDescriptionstatic Collector
<Substring.Pattern, ?, Substring.Pattern> Substring.firstOccurrence()
Returns aCollector
that collects the input candidateSubstring.Pattern
and reults in a pattern that matches whichever that occurs first in the input string.static Collector
<Substring.Pattern, ?, Substring.Pattern> Substring.firstOccurrence()
Returns aCollector
that collects the input candidateSubstring.Pattern
and reults in a pattern that matches whichever that occurs first in the input string.Modifier and TypeMethodDescriptionstatic Substring.Pattern
Substring.after
(Substring.Pattern delimiter) Returns aPattern
that covers the substring afterdelimiter
.static Substring.Pattern
Substring.before
(Substring.Pattern delimiter) Returns aPattern
that covers the substring beforedelimiter
.static Substring.Pattern
Substring.between
(Substring.Pattern open, Substring.BoundStyle openBound, Substring.Pattern close, Substring.BoundStyle closeBound) Similar toSubstring.between(Pattern, Pattern)
but allows to use alternative bound styles to include or exclude the delimiters at both ends.static Substring.Pattern
Substring.between
(Substring.Pattern open, Substring.Pattern close) Returns aPattern
that will match the substring betweenopen
andclose
.final Substring.Pattern
Substring.Pattern.or
(Substring.Pattern that) Returns aPattern
that falls back to usingthat
ifthis
fails to match.Substring.Pattern.peek
(Substring.Pattern following) Return aPattern
equivalent to thisPattern
, except it will fail to match if thefollowing
pattern can't find a match in the substring after the current match.Substring.RepeatingPattern.splitKeyValuesAround
(Substring.Pattern keyValueSeparator, String input) Returns aBiStream
of key value pairs frominput
.Substring.RepeatingPattern.splitThenTrimKeyValuesAround
(Substring.Pattern keyValueSeparator, String input) Returns aBiStream
of key value pairs frominput
.final Substring.Pattern
Substring.Pattern.then
(Substring.Pattern following) Similar to regex lookahead, returns a pattern that matches thefollowing
pattern after it has matched this pattern.static Substring.Pattern
Substring.upToIncluding
(Substring.Pattern pattern) Returns aPattern
that will match from the beginning of the original string up to the substring matched bypattern
inclusively.