org.apache.stanbol.entityhub.servicesapi.util
Class PatternUtils
java.lang.Object
org.apache.stanbol.entityhub.servicesapi.util.PatternUtils
public final class PatternUtils
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREFIX_REGEX_PATTERN
public static final Pattern PREFIX_REGEX_PATTERN
wildcardToRegex
public static String wildcardToRegex(String wildcard,
boolean strict)
- Converts a Wildcard search string to REGEX. If strict is enabled, than
the REGEX pattern searches only full labels ("^Patt?er.*$") otherwise
it searches the whole text ("Patt?er.*")
- Parameters:
wildcard - the wildcard patternstrict - if true than the REGEX pattern searches
whole words.
- Returns:
- the pattern
value2Regex
public static String value2Regex(String value)
escapeRegex
public static String escapeRegex(String wildcard)
usesWildCard
public static boolean usesWildCard(String value)
- Returns
true if the parsed value contains an '?' or '*'
- Parameters:
value - the value to check
- Returns:
true if the parsed value contains an '?' or '*'
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.