net.sourceforge.jaulp.regex
Class REUtils

java.lang.Object
  extended by net.sourceforge.jaulp.regex.REUtils

public class REUtils
extends java.lang.Object

Utility class for the use with regular expressions.

Version:
1.0
Author:
Asterios Raptis

Field Summary
static java.lang.String VALID_CHARS_IN_FILENAME
          Regular expression class for the valid characters in a filename.
static java.lang.String WILDCARD_ASTERISK
          Constant for the wildcard asterisk "*".
static java.lang.String WILDCARD_MANYCHARS_RE
          Regular expression for many characters in the filename.
static java.lang.String WILDCARD_ONECHAR_RE
          Regular expression for exactly on character in the filename.
static java.lang.String WILDCARD_QUESTION_MARK
          Constant for the wildcard interrogation mark "?".
 
Constructor Summary
REUtils()
           
 
Method Summary
static java.lang.String replaceWildcardsWithRE(java.lang.String queryString)
          Replaces the normal wildcards in the given String with the corresponding regular expression wildcards.
static java.lang.String wildcardCriterionSQL(java.lang.String query)
          Replaces the query with the wildcards asterisk "*" and interrogation mark "?"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WILDCARD_ASTERISK

public static final java.lang.String WILDCARD_ASTERISK
Constant for the wildcard asterisk "*". Current value:"*"

See Also:
Constant Field Values

WILDCARD_QUESTION_MARK

public static final java.lang.String WILDCARD_QUESTION_MARK
Constant for the wildcard interrogation mark "?". Current value:"?"

See Also:
Constant Field Values

VALID_CHARS_IN_FILENAME

public static final java.lang.String VALID_CHARS_IN_FILENAME
Regular expression class for the valid characters in a filename. Current value:"[a-zA-Z0-9._-]"

See Also:
Constant Field Values

WILDCARD_ONECHAR_RE

public static final java.lang.String WILDCARD_ONECHAR_RE
Regular expression for exactly on character in the filename. Current value:"[a-zA-Z0-9._-]{1}"

See Also:
Constant Field Values

WILDCARD_MANYCHARS_RE

public static final java.lang.String WILDCARD_MANYCHARS_RE
Regular expression for many characters in the filename. Current value:".*"

See Also:
Constant Field Values
Constructor Detail

REUtils

public REUtils()
Method Detail

wildcardCriterionSQL

public static java.lang.String wildcardCriterionSQL(java.lang.String query)
Replaces the query with the wildcards asterisk "*" and interrogation mark "?" with the corresponding wildcard from SQL.

Parameters:
query - The String to replace the wildcards.
Returns:
The String with the new wildcards from SQL "%" and "_".

replaceWildcardsWithRE

public static java.lang.String replaceWildcardsWithRE(java.lang.String queryString)
Replaces the normal wildcards in the given String with the corresponding regular expression wildcards.

Parameters:
queryString - The String to format.
Returns:
Returns the formatted String as a regular expression for search.


Copyright © 2010. All Rights Reserved.