| java.lang.Object sunlabs.brazil.util.Glob
Glob | public class Glob (Code) | | Glob-style string matching and substring extraction. Glob was
implemented by translating the glob package for
tcl8.0.
- "*" matches 0 or more characters
- "?" matches a single character
- "[...]" matches a set and/or range of characters
- "\" following character is not special
Each of the substrings matching (?, *, or [..]) are returned.
author: Colin Stevens (colin.stevens@sun.com) version: 1.6, 99/11/09 |
Method Summary | |
public static boolean | match(String pattern, String string) Match a string against a pattern. | public static boolean | match(String pattern, String string, String[] substr) Match a string against a pattern, and return sub-matches.
The caller can provide an array of strings that will be filled in with
the substrings of string that matched the glob
meta-characters in pattern . |
match | public static boolean match(String pattern, String string)(Code) | | Match a string against a pattern.
Parameters: pattern - Glob pattern. Parameters: string - String to match against pattern. true if the string matched the pattern,false otherwise. |
match | public static boolean match(String pattern, String string, String[] substr)(Code) | | Match a string against a pattern, and return sub-matches.
The caller can provide an array of strings that will be filled in with
the substrings of string that matched the glob
meta-characters in pattern . The array of strings may be
partially modified even if the string did not match the glob pattern.
The array may contain more elements than glob meta-characters, in
which case those extra elements will not be modified; the array may
also contain fewer elements or even be null , to ignore
some or all of the glob meta-characters. In other words, the user can
pass pretty much anything and this method defines errors out of
existence.
Parameters: pattern - Glob pattern. Parameters: string - String to match against pattern. Parameters: substr - Array of strings provided by the caller, to be filled inwith the substrings that matched the glob meta-characters.May be null . true if the string matched the pattern,false otherwise. |
|
|