diff options
Diffstat (limited to 'doc/RegExp.3')
-rw-r--r-- | doc/RegExp.3 | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/doc/RegExp.3 b/doc/RegExp.3 index 85ff80e..ce4c7d9 100644 --- a/doc/RegExp.3 +++ b/doc/RegExp.3 @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: RegExp.3,v 1.21 2005/04/06 20:55:22 dkf Exp $ +'\" RCS: @(#) $Id: RegExp.3,v 1.22 2005/05/03 18:07:43 dgp Exp $ '\" .so man.macros .TH Tcl_RegExpMatch 3 8.1 Tcl "Tcl Library Procedures" @@ -18,16 +18,16 @@ Tcl_RegExpMatch, Tcl_RegExpCompile, Tcl_RegExpExec, Tcl_RegExpRange, Tcl_GetRegE \fB#include <tcl.h>\fR .sp int -\fBTcl_RegExpMatchObj\fR(\fIinterp\fR, \fIstrObj\fR, \fIpatObj\fR) +\fBTcl_RegExpMatchObj\fR(\fIinterp\fR, \fItextObj\fR, \fIpatObj\fR) .sp int -\fBTcl_RegExpMatch\fR(\fIinterp\fR, \fIstring\fR, \fIpattern\fR) +\fBTcl_RegExpMatch\fR(\fIinterp\fR, \fItext\fR, \fIpattern\fR) .sp Tcl_RegExp \fBTcl_RegExpCompile\fR(\fIinterp\fR, \fIpattern\fR) .sp int -\fBTcl_RegExpExec\fR(\fIinterp\fR, \fIregexp\fR, \fIstring\fR, \fIstart\fR) +\fBTcl_RegExpExec\fR(\fIinterp\fR, \fIregexp\fR, \fItext\fR, \fIstart\fR) .sp void \fBTcl_RegExpRange\fR(\fIregexp\fR, \fIindex\fR, \fIstartPtr\fR, \fIendPtr\fR) @@ -36,7 +36,7 @@ Tcl_RegExp \fBTcl_GetRegExpFromObj\fR(\fIinterp\fR, \fIpatObj\fR, \fIcflags\fR) .sp int -\fBTcl_RegExpExecObj\fR(\fIinterp\fR, \fIregexp\fR, \fIobjPtr\fR, \fIoffset\fR, \fInmatches\fR, \fIeflags\fR) +\fBTcl_RegExpExecObj\fR(\fIinterp\fR, \fIregexp\fR, \fItextObj\fR, \fIoffset\fR, \fInmatches\fR, \fIeflags\fR) .sp void \fBTcl_RegExpGetInfo\fR(\fIregexp\fR, \fIinfoPtr\fR) @@ -46,24 +46,24 @@ void .AP Tcl_Interp *interp in Tcl interpreter to use for error reporting. The interpreter may be NULL if no error reporting is desired. -.AP Tcl_Obj *strObj in/out -Refers to the object from which to get the string to search. The +.AP Tcl_Obj *textObj in/out +Refers to the object from which to get the text to search. The internal representation of the object may be converted to a form that can be efficiently searched. .AP Tcl_Obj *patObj in/out Refers to the object from which to get a regular expression. The compiled regular expression is cached in the object. -.AP char *string in -String to check for a match with a regular expression. +.AP char *text in +Text to search for a match with a regular expression. .AP "const char" *pattern in String in the form of a regular expression pattern. .AP Tcl_RegExp regexp in Compiled regular expression. Must have been returned previously by \fBTcl_GetRegExpFromObj\fR or \fBTcl_RegExpCompile\fR. .AP char *start in -If \fIstring\fR is just a portion of some other string, this argument +If \fItext\fR is just a portion of some other string, this argument identifies the beginning of the larger string. -If it isn't the same as \fIstring\fR, then no \fB^\fR matches +If it isn't the same as \fItext\fR, then no \fB^\fR matches will be allowed. .AP int index in Specifies which range is desired: 0 means the range of the entire @@ -77,11 +77,8 @@ The address of the character just after the last one in the range is stored here, or NULL if there is no such range. .AP int cflags in OR-ed combination of compilation flags. See below for more information. -.AP Tcl_Obj *objPtr in/out -An object which contains the string to check for a match with a -regular expression. .AP int offset in -The character offset into the string where matching should begin. +The character offset into the text where matching should begin. The value of the offset has no impact on \fB^\fR matches. This behavior is controlled by \fIeflags\fR. .AP int nmatches in @@ -111,7 +108,7 @@ If an error occurs in the matching process (e.g. \fIpattern\fR is not a valid regular expression) then \fBTcl_RegExpMatch\fR returns \-1 and leaves an error message in the interpreter result. \fBTcl_RegExpMatchObj\fR is similar to \fBTcl_RegExpMatch\fR except it -operates on the Tcl objects \fIstrObj\fR and \fIpatObj\fR instead of +operates on the Tcl objects \fItextObj\fR and \fIpatObj\fR instead of UTF strings. \fBTcl_RegExpMatchObj\fR is generally more efficient than \fBTcl_RegExpMatch\fR, so it is the preferred interface. @@ -130,7 +127,7 @@ up to the next call to \fBTcl_RegExpCompile\fR; it is not safe to retain these values for long periods of time. .PP \fBTcl_RegExpExec\fR executes the regular expression pattern matcher. -It returns 1 if \fIstring\fR contains a range of characters that +It returns 1 if \fItext\fR contains a range of characters that match \fIregexp\fR, 0 if no match is found, and \-1 if an error occurs. In the case of an error, \fBTcl_RegExpExec\fR leaves an error @@ -139,14 +136,14 @@ When searching a string for multiple matches of a pattern, it is important to distinguish between the start of the original string and the start of the current search. For example, when searching for the second occurrence of a -match, the \fIstring\fR argument might point to the character +match, the \fItext\fR argument might point to the character just after the first match; however, it is important for the pattern matcher to know that this is not the start of the entire string, so that it doesn't allow \fB^\fR atoms in the pattern to match. The \fIstart\fR argument provides this information by pointing -to the start of the overall string containing \fIstring\fR. -\fIStart\fR will be less than or equal to \fIstring\fR; if it -is less than \fIstring\fR then no \fB^\fR matches will be allowed. +to the start of the overall string containing \fItext\fR. +\fIStart\fR will be less than or equal to \fItext\fR; if it +is less than \fItext\fR then no \fB^\fR matches will be allowed. .PP \fBTcl_RegExpRange\fR may be invoked after \fBTcl_RegExpExec\fR returns; it provides detailed information about what ranges of |