Name

lsearch

lsearch [mode] list pattern

Search list for an element that matches pattern. If found, return the index of the matching element; otherwise, return −1. The type of search is defined by one of the following mode options:

-exact

Use exact matching.

-glob

Use glob pattern matching (default).

-regexp

Use regular expression matching.

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.