Java EE 5 SDK

com.sun.appserv.management.util.misc
Class RegexUtil

java.lang.Object
  extended by com.sun.appserv.management.util.misc.RegexUtil

public final class RegexUtil
extends Object

Useful utilities for regex handling


Field Summary
static String REGEX_SPECIALS
          These characters will be escaped by wildcardToJavaRegex()
 
Method Summary
static Pattern[] exprsToPatterns(String[] exprs)
          Converts each String to a Pattern using wildcardToJavaRegex
static Pattern[] exprsToPatterns(String[] exprs, int flags)
          Converts each String to a Pattern using wildcardToJavaRegex, passing the flags.
static String wildcardToJavaRegex(String input)
          Supports the single wildcard "*".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REGEX_SPECIALS

public static final String REGEX_SPECIALS
These characters will be escaped by wildcardToJavaRegex()

See Also:
Constant Field Values
Method Detail

exprsToPatterns

public static Pattern[] exprsToPatterns(String[] exprs)
Converts each String to a Pattern using wildcardToJavaRegex

Parameters:
exprs - String[] of expressions
Returns:
Pattern[], one for each String

exprsToPatterns

public static Pattern[] exprsToPatterns(String[] exprs,
                                        int flags)
Converts each String to a Pattern using wildcardToJavaRegex, passing the flags.

Parameters:
exprs - String[] of expressions
flags - flags to pass to Pattern.compile
Returns:
Pattern[], one for each String

wildcardToJavaRegex

public static String wildcardToJavaRegex(String input)
Supports the single wildcard "*". There is no support for searching for a literal "*". Convert a string to a form suitable for passing to java.util.regex.


Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.