home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / doc / RegExp.3 < prev    next >
Text File  |  1993-05-05  |  2KB  |  58 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/RegExp.3,v 1.1 93/05/05 17:06:04 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tcl_RegExpMatch tclc 7.0
  25. .BS
  26. .SH NAME
  27. Tcl_RegExpMatch \- Test whether a string matches a regular expression
  28. .SH SYNOPSIS
  29. .nf
  30. \fB#include <tcl.h>\fR
  31. .sp
  32. int
  33. \fBTcl_RegExpMatch\fR(\fIinterp\fR, \fIstring\fR, \fIregexp\fR)
  34. .SH ARGUMENTS
  35. .AS Tcl_Interp *interp
  36. .AP Tcl_Interp *interp in
  37. Tcl interpreter to use for error reporting.
  38. .AP char *string in
  39. String to test.
  40. .AP char *regexp in
  41. Regular expression to match against \fIstring\fR.
  42. .BE
  43.  
  44. .SH DESCRIPTION
  45. .PP
  46. \fBTcl_RegExpMatch\fR determines whether its \fIstring\fR argument
  47. matches \fIregexp\fR, where \fIregexp\fR is interpreted
  48. as a regular expression using the same rules as for the
  49. \fBregexp\fR Tcl command.
  50. If there is a match then \fBTcl_RegExpMatch\fR returns 1.
  51. If there is no match then \fBTcl_RegExpMatch\fR returns 0.
  52. If an error occurs in the matching process (e.g. \fIregexp\fR
  53. is not a valid regular expression) then \fBTcl_RegExpMatch\fR
  54. returns \-1 and leaves an error message in \fIinterp->result\fR.
  55.  
  56. .SH KEYWORDS
  57. match, regular expression, string
  58.