org.elasticsearch.common.regex
Class Regex
java.lang.Object
org.elasticsearch.common.regex.Regex
public class Regex
- extends java.lang.Object
Constructor Summary |
Regex()
|
Method Summary |
static java.util.regex.Pattern |
compile(java.lang.String regex,
java.lang.String flags)
|
static int |
flagsFromString(java.lang.String flags)
|
static java.lang.String |
flagsToString(int flags)
|
static boolean |
isSimpleMatchPattern(java.lang.String str)
Is the str a simple match pattern. |
static boolean |
simpleMatch(java.lang.String[] patterns,
java.lang.String str)
Match a String against the given patterns, supporting the following simple
pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an
arbitrary number of pattern parts), as well as direct equality. |
static boolean |
simpleMatch(java.lang.String pattern,
java.lang.String str)
Match a String against the given pattern, supporting the following simple
pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an
arbitrary number of pattern parts), as well as direct equality. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Regex
public Regex()
isSimpleMatchPattern
public static boolean isSimpleMatchPattern(java.lang.String str)
- Is the str a simple match pattern.
simpleMatch
public static boolean simpleMatch(java.lang.String pattern,
java.lang.String str)
- Match a String against the given pattern, supporting the following simple
pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an
arbitrary number of pattern parts), as well as direct equality.
- Parameters:
pattern
- the pattern to match againststr
- the String to match
- Returns:
- whether the String matches the given pattern
simpleMatch
public static boolean simpleMatch(java.lang.String[] patterns,
java.lang.String str)
- Match a String against the given patterns, supporting the following simple
pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an
arbitrary number of pattern parts), as well as direct equality.
- Parameters:
patterns
- the patterns to match againststr
- the String to match
- Returns:
- whether the String matches any of the given patterns
compile
public static java.util.regex.Pattern compile(java.lang.String regex,
java.lang.String flags)
flagsFromString
public static int flagsFromString(java.lang.String flags)
flagsToString
public static java.lang.String flagsToString(int flags)