Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/StrMatch.3 @ 33

Last change on this file since 33 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 1.7 KB
Line 
1'\"
2'\" Copyright (c) 1989-1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: StrMatch.3,v 1.14 2007/12/13 15:22:32 dgp Exp $
9'\"
10.so man.macros
11.TH Tcl_StringMatch 3 8.5 Tcl "Tcl Library Procedures"
12.BS
13.SH NAME
14Tcl_StringMatch, Tcl_StringCaseMatch \- test whether a string matches a pattern
15.SH SYNOPSIS
16.nf
17\fB#include <tcl.h>\fR
18.sp
19int
20\fBTcl_StringMatch\fR(\fIstr\fR, \fIpattern\fR)
21.sp
22int
23\fBTcl_StringCaseMatch\fR(\fIstr\fR, \fIpattern\fR, \fIflags\fR)
24.SH ARGUMENTS
25.AS "const char" *pattern
26.AP "const char" *str in
27String to test.
28.AP "const char" *pattern in
29Pattern to match against string.  May contain special
30characters from the set *?\e[].
31.AP int flags in
32OR-ed combination of match flags, currently only \fBTCL_MATCH_NOCASE\fR.
330 specifies a case-sensitive search.
34.BE
35
36.SH DESCRIPTION
37.PP
38This utility procedure determines whether a string matches
39a given pattern.  If it does, then \fBTcl_StringMatch\fR returns
401.  Otherwise \fBTcl_StringMatch\fR returns 0.  The algorithm
41used for matching is the same algorithm used in the \fBstring match\fR
42Tcl command and is similar to the algorithm used by the C-shell
43for file name matching;  see the Tcl manual entry for details.
44.PP
45In \fBTcl_StringCaseMatch\fR, the algorithm is
46the same, but you have the option to make the matching case-insensitive.
47If you choose this (by passing \fBTCL_MATCH_NOCASE\fR), then the string and
48pattern are essentially matched in the lower case.
49
50.SH KEYWORDS
51match, pattern, string
Note: See TracBrowser for help on using the repository browser.