org.apache.stanbol.entityhub.servicesapi.util
Class PatternUtils

java.lang.Object
  extended by org.apache.stanbol.entityhub.servicesapi.util.PatternUtils

public final class PatternUtils
extends Object


Field Summary
static Pattern PREFIX_REGEX_PATTERN
           
 
Method Summary
static String escapeRegex(String wildcard)
           
static boolean usesWildCard(String value)
          Returns true if the parsed value contains an '?' or '*'
static String value2Regex(String value)
           
static String wildcardToRegex(String wildcard, boolean strict)
          Converts a Wildcard search string to REGEX.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX_REGEX_PATTERN

public static final Pattern PREFIX_REGEX_PATTERN
Method Detail

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 pattern
strict - 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.