|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsunlabs.brazil.util.Glob (view source)
public class Glob
Glob-style string matching and substring extraction. Glob was implemented by translating the glob package for tcl8.0.
Method Summary | |
---|---|
static boolean |
match(String pattern,
String string)
Match a string against a pattern. |
static boolean |
match(String pattern,
String string,
String[] substr)
Match a string against a pattern, and return sub-matches. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean match(String pattern, String string)
pattern
- Glob pattern. Nothing matches if pattern==null.string
- String to match against pattern.
true
if the string matched the pattern,
false
otherwise.public static boolean match(String pattern, String string, String[] substr)
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.
pattern
- Glob pattern.string
- String to match against pattern.substr
- Array of strings provided by the caller, to be filled in
with the substrings that matched the glob meta-characters.
May be null
.
true
if the string matched the pattern,
false
otherwise.
|
Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |