public class WildcardPattern extends Pattern
? - matches any single character;
* - matches any number of any characters;
- all the rest - matches itself.
Each wildcard takes a capturing group withing a pattern.
Pattern
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANY_CHAR |
static java.lang.String |
WORD_CHAR |
DEFAULT, DOTALL, IGNORE_CASE, IGNORE_SPACES, MULTILINE, UNICODE, XML_SCHEMA
Modifier | Constructor and Description |
---|---|
protected |
WildcardPattern() |
|
WildcardPattern(java.lang.String wc) |
|
WildcardPattern(java.lang.String wc,
boolean icase) |
|
WildcardPattern(java.lang.String wc,
int flags) |
|
WildcardPattern(java.lang.String wc,
java.lang.String wcClass,
int flags) |
Modifier and Type | Method and Description |
---|---|
protected void |
compile(java.lang.String wc,
java.lang.String wcClass,
java.lang.String specials,
int flags) |
protected static java.lang.String |
convertSpecials(java.lang.String s,
java.lang.String wcClass,
java.lang.String specials) |
java.lang.String |
toString() |
compile, compile, compileInt, groupCount, groupId, matcher, matcher, matcher, matcher, matcher, matcher, matches, replacer, replacer, startsWith, tokenizer, tokenizer, tokenizer, toString_d
public static final java.lang.String WORD_CHAR
public static final java.lang.String ANY_CHAR
public WildcardPattern(java.lang.String wc)
wc
- The patternpublic WildcardPattern(java.lang.String wc, boolean icase)
wc
- The patternicase
- If true, the pattern is case-insensitive.public WildcardPattern(java.lang.String wc, int flags)
wc
- The patternflags
- The bitwise OR of any of REFlags.* . The only meaningful
flags are REFlags.IGNORE_CASE and REFlags.DOTALL (the latter allows
the wildcards to match the EOL characters).public WildcardPattern(java.lang.String wc, java.lang.String wcClass, int flags)
wc
- The patternwcClass
- The wildcard class, could be any of WORD_CHAR or ANY_CHARflags
- The bitwise OR of any of REFlags.* . The only meaningful
flags are REFlags.IGNORE_CASE and REFlags.DOTALL (the latter allows
the wildcards to match the EOL characters).protected WildcardPattern()