public interface Pattern
| Modifier and Type | Field and Description |
|---|---|
static int |
CANON_EQ |
static int |
CASE_INSENSITIVE |
static int |
COMMENTS |
static int |
DOTALL |
static int |
LITERAL |
static int |
MULTILINE |
static int |
UNICODE_CASE |
static int |
UNICODE_CHARACTER_CLASS |
static int |
UNIX_LINES |
| Modifier and Type | Method and Description |
|---|---|
Predicate<String> |
asMatchPredicate()
Creates a predicate that tests if this pattern matches a given input string.
|
Predicate<String> |
asPredicate()
Creates a predicate that tests if this pattern is found in a given input string.
|
int |
flags() |
Matcher |
matcher(CharSequence subject) |
boolean |
matches(CharSequence subject,
int offset) |
String |
pattern() |
String[] |
split(CharSequence input) |
String[] |
split(CharSequence input,
int limit) |
Stream<String> |
splitAsStream(CharSequence input)
Creates a stream from the given input sequence around matches of this pattern.
|
static final int CANON_EQ
Pattern.CANON_EQ,
Constant Field Valuesstatic final int CASE_INSENSITIVE
Pattern.CASE_INSENSITIVE,
Constant Field Valuesstatic final int COMMENTS
Pattern.COMMENTS,
Constant Field Valuesstatic final int DOTALL
Pattern.DOTALL,
Constant Field Valuesstatic final int LITERAL
Pattern.LITERAL,
Constant Field Valuesstatic final int MULTILINE
Pattern.MULTILINE,
Constant Field Valuesstatic final int UNICODE_CASE
Pattern.UNICODE_CASE,
Constant Field Valuesstatic final int UNIX_LINES
Pattern.UNIX_LINES,
Constant Field Valuesstatic final int UNICODE_CHARACTER_CLASS
String pattern()
Pattern.pattern()Matcher matcher(CharSequence subject)
Pattern.matcher(CharSequence)int flags()
Pattern.flags()boolean matches(CharSequence subject, int offset)
this patternPattern.matches(String, CharSequence)String[] split(CharSequence input)
Pattern.split(CharSequence)String[] split(CharSequence input, int limit)
Pattern.split(CharSequence, int)Predicate<String> asPredicate()
API Note: This method creates a predicate that behaves as if it creates a matcher from the input sequence and then calls find, for example a predicate of the form:
s -> matcher(s).find();
Predicate<String> asMatchPredicate()
API Note: This method creates a predicate that behaves as if it creates a matcher from the input sequence and then calls matches, for example a predicate of the form:
s -> matcher(s).matches();
Stream<String> splitAsStream(CharSequence input)
If this pattern does not match any subsequence of the input then the resulting stream has just one element, namely the input sequence in string form.
When there is a positive-width match at the beginning of the input sequence then an empty leading substring is included at the beginning of the stream. A zero-width match at the beginning however never produces such empty leading substring.
If the input sequence is mutable, it must remain constant during the execution of the terminal stream operation. Otherwise, the result of the terminal stream operation is undefined.
input - The character sequence to be splitCopyright © 2022 Arno Unkrig. All rights reserved.