"Fossies" - the Fresh Open Source Software archive

Member "jacl1.4.1/docs/TclJavaLib/Util.htm" of archive jacl1.4.1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.

CLASS
tcl.lang.Util -- This class contains static utility routines.
METHODS
static boolean stringMatch(String string, String pattern)
ARGUMENTS
DESCRIPTION
stringMatch
*
?
[chars]
\x
EQUIVALENT C FUNCTIONS
SEE ALSO
KEYWORDS

CLASS

tcl.lang.Util -- This class contains static utility routines.

METHODS

static boolean stringMatch(String string, String pattern)

ARGUMENTS

String string ()
String to check for a match with pattern.

String pattern ()
Pattern to match string against.

DESCRIPTION

This class contains utility routines that do not naturally fit into other classes in the tcl.lang package. Currently, only one method is public. However, more are likely to be offered in the future.

stringMatch
The stringMatch method returns a boolean depending on whether string matches with the pattern according to Tcl's "glob" rules. For the two strings to match, their contents must be identical except that the following special sequences may appear in pattern:

*
Matches any sequence of characters in string, including a null string.

?
Matches any single character in string.

[chars]
Matches any character in the set given by chars. If a sequence of the form x-y appears in chars, then any character between x and y, inclusive, will match.

\x
Matches the single character x. This provides a way of avoiding the special interpretation of the characters *?[]\ in pattern.

EQUIVALENT C FUNCTIONS

Tcl_StringMatch

SEE ALSO

string, glob, regexp

KEYWORDS

glob, regexp, string, string match, utility
Copyright © 1996-1998 Sun Microsystems, Inc.
Copyright © 1995-1997 Roger E. Critchlow Jr.