org.avis.util
Class Wildcard

java.lang.Object
  extended by org.avis.util.Wildcard

public final class Wildcard
extends Object

Generates regex patterns that match Unix-style wildcards * and ?. Currently handles * and ? by generating regex equivalents.


Method Summary
static Pattern toPattern(String wildcard)
          Generate a patten matcher for a wildcard expression.
static Pattern toPattern(String wildcard, int flags)
          Generate a patten matcher for a wildcard expression.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toPattern

public static Pattern toPattern(String wildcard)
Generate a patten matcher for a wildcard expression.

Parameters:
wildcard - The wildcard expression.
Returns:
A pattern that matches the wildcard.

toPattern

public static Pattern toPattern(String wildcard,
                                int flags)
Generate a patten matcher for a wildcard expression.

Parameters:
wildcard - The wildcard expression.
flags - The patten flags (e.g Pattern.CASE_INSENSITIVE).
Returns:
A pattern that matches the wildcard.


Copyright © 2008 Matthew Phillips. All Rights Reserved.