1Tcl_StringMatch(3) Tcl Library Procedures Tcl_StringMatch(3)
2
3
4
5______________________________________________________________________________
6
8 Tcl_StringMatch, Tcl_StringCaseMatch - test whether a string matches a
9 pattern
10
12 #include <tcl.h>
13
14 int
15 Tcl_StringMatch(str, pattern)
16
17 int
18 Tcl_StringCaseMatch(str, pattern, flags)
19
21 const char *str (in) String to test.
22
23 const char *pattern (in) Pattern to match against string. May
24 contain special characters from the
25 set *?\[].
26
27 int flags (in) OR-ed combination of match flags,
28 currently only TCL_MATCH_NOCASE. 0
29 specifies a case-sensitive search.
30_________________________________________________________________
31
32
34 This utility procedure determines whether a string matches a given pat‐
35 tern. If it does, then Tcl_StringMatch returns 1. Otherwise
36 Tcl_StringMatch returns 0. The algorithm used for matching is the same
37 algorithm used in the string match Tcl command and is similar to the
38 algorithm used by the C-shell for file name matching; see the Tcl man‐
39 ual entry for details.
40
41 In Tcl_StringCaseMatch, the algorithm is the same, but you have the
42 option to make the matching case-insensitive. If you choose this (by
43 passing TCL_MATCH_NOCASE), then the string and pattern are essentially
44 matched in the lower case.
45
46
48 match, pattern, string
49
50
51
52Tcl 8.5 Tcl_StringMatch(3)