home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / doc / lsearch.n < prev    next >
Text File  |  1993-05-07  |  2KB  |  61 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/lsearch.n,v 1.2 93/05/07 14:27:07 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS lsearch tcl 7.0
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. lsearch \- See if a list contains a particular element
  29. .SH SYNOPSIS
  30. \fBlsearch \fR?\fImode\fR? \fIlist pattern\fR
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. This command searches the elements of \fIlist\fR to see if one
  36. of them matches \fIpattern\fR.
  37. If so, the command returns the index of the first matching
  38. element.
  39. If not, the command returns \fB\-1\fR.
  40. .VS
  41. The \fImode\fR argument indicates how the elements of the list are to
  42. be matched against \fIpattern\fR and it must have one of the following
  43. values:
  44. .TP
  45. \fB\-exact\fR
  46. The list element must contain exactly the same string as \fIpattern\fR.
  47. .TP
  48. \fB\-glob\fR
  49. \fIPattern\fR is a glob-style pattern which is matched against each list
  50. element using the same rules as the \fBstring match\fR command.
  51. .TP
  52. \fB\-regexp\fR
  53. \fIPattern\fR is treated as a regular expression and matched against
  54. each list element using the same rules as the \fBregexp\fR command.
  55. .PP
  56. If \fImode\fR is omitted then it defaults to \fB\-glob\fR.
  57. .VE
  58.  
  59. .SH KEYWORDS
  60. list, match, pattern, regular expression, search, string
  61.