Tcl_StringMatch(3)
π NAME π
Tcl_StringMatch, Tcl_StringCaseMatch β bestie, these two are literally here to test whether a string matches a pattern β¨
πΈ SYNOPSIS πΈ
#include <tcl.h>
int
Tcl_StringMatch(str, pattern)
int
Tcl_StringCaseMatch(str, pattern, flags)
π ARGUMENTS π
const char *str(in) β the string you're putting on the vibe check. πconst char *pattern(in) β the pattern you're matching against that string. It may contain special characters from the set*?\[]β yep, those four are the main characters here. πint flags(in) β an OR-ed combination of match flags. Right now the only one on the roster isTCL_MATCH_NOCASE. Pass0and you get a case-sensitive search, no cap.
β¨ DESCRIPTION β¨
Okay so, this utility procedure figures out whether a string matches a given pattern. Does it match? Tcl_StringMatch hands you back 1. Does it not? You get 0. That's the whole thing, fr fr. π«Ά
The algorithm it uses for matching is the same algorithm used in the string match Tcl command, and it's similar to the algorithm the C-shell uses for file name matching. Want the details? Go read the Tcl manual entry for it, iykyk. π
Now in Tcl_StringCaseMatch, the algorithm is the same, but you get the option to make the matching case-insensitive. If you choose that (by passing TCL_MATCH_NOCASE), then the string and the pattern are essentially matched in the lower case. Lowercase everything and let them vibe. π
π¦ KEYWORDS π¦
match, pattern, string
and that's the whole page, bestie β no notes, she ate π
this one came from the Tcl Library Procedures, version 8.5, dated the same as ever, and the footer just says Tcl_StringMatch(3) β mwah, periodt π
π¦ where this page comes from
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- fedora 43: tcl-doc 1:9.0.2-1.fc43 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- fedora 44: tcl-doc 1:9.0.2-1.fc44 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- nixos 26.05: tcl 9.0.3
- nixpkgs unstable: tcl 9.1.0
- Copyright (c) 1989-1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms