public abstract class PatternFactory extends Object
To get
ServiceLoader<PatternFactory> patternFactory = ServiceLoader.load(PatternFactory.class);
| Constructor and Description |
|---|
PatternFactory() |
| Modifier and Type | Method and Description |
|---|---|
Pattern |
compile(String regex)
Compiles the given regex into a
Pattern. |
abstract Pattern |
compile(String regex,
int flags)
Compiles the given regex into a
Pattern with the given flags. |
static PatternFactory |
get()
Returns the pattern factory configured in this JVM.
|
static PatternFactory |
get(String fullyQualifiedClassName) |
abstract String |
getId() |
abstract int |
getSupportedFlags() |
abstract boolean |
matches(String regex,
CharSequence input) |
String |
quote(String s) |
String |
quoteReplacement(String s) |
public static PatternFactory get()
java.util.regex pattern factory
EnhancedServiceLoader.load(Class)public abstract String getId()
@Nullable public static PatternFactory get(String fullyQualifiedClassName)
PatternFactory classpublic abstract int getSupportedFlags()
this engine.public Pattern compile(String regex) throws PatternSyntaxException
Pattern.PatternSyntaxExceptionpublic abstract Pattern compile(String regex, int flags) throws PatternSyntaxException
Pattern with the given flags.flags - The or'ed compilation flag constants declared by PatternIllegalArgumentException - A flag was given that is not set in getSupportedFlags()PatternSyntaxExceptionPattern.compile(String, int),
Pattern.compile(String),
Pattern.CANON_EQ,
Pattern.CASE_INSENSITIVE,
Pattern.COMMENTS,
Pattern.DOTALL,
Pattern.LITERAL,
Pattern.MULTILINE,
Pattern.UNICODE_CASE,
Pattern.UNICODE_CHARACTER_CLASS,
Pattern.UNIX_LINESpublic abstract boolean matches(String regex, CharSequence input)
Pattern.matches(String, CharSequence)public String quote(String s)
Pattern.quote(String)public String quoteReplacement(String s)
Matcher.quoteReplacement(String)Copyright © 2022 Arno Unkrig. All rights reserved.