diff options
Diffstat (limited to 'tcl/doc/regsub.n')
-rw-r--r-- | tcl/doc/regsub.n | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/tcl/doc/regsub.n b/tcl/doc/regsub.n index a6605d1bfca..0e0f60b69ed 100644 --- a/tcl/doc/regsub.n +++ b/tcl/doc/regsub.n @@ -1,6 +1,7 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" Copyright (c) 2000 Scriptics Corporation. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -8,7 +9,7 @@ '\" RCS: @(#) $Id$ '\" .so man.macros -.TH regsub n 7.4 Tcl "Tcl Built-In Commands" +.TH regsub n 8.3 Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -23,6 +24,8 @@ This command matches the regular expression \fIexp\fR against \fIstring\fR, and it copies \fIstring\fR to the variable whose name is given by \fIvarName\fR. +(Regular expression matching is described in the \fBre_syntax\fR +reference page.) If there is a match, then while copying \fIstring\fR to \fIvarName\fR the portion of \fIstring\fR that matched \fIexp\fR is replaced with \fIsubSpec\fR. @@ -53,11 +56,45 @@ matching range is found and substituted. If \fB\-all\fR is specified, then ``&'' and ``\e\fIn\fR'' sequences are handled for each substitution using the information from the corresponding match. +.TP 15 +\fB\-expanded\fR +Enables use of the expanded regular expression syntax where +whitespace and comments are ignored. This is the same as specifying +the \fB(?x)\fR embedded option (see METASYNTAX, below). +.TP 15 +\fB\-line\fR +Enables newline-sensitive matching. By default, newline is a +completely ordinary character with no special meaning. With this +flag, `[^' bracket expressions and `.' never match newline, `^' +matches an empty string after any newline in addition to its normal +function, and `$' matches an empty string before any newline in +addition to its normal function. This flag is equivalent to +specifying both \fB\-linestop\fR and \fB\-lineanchor\fR, or the +\fB(?n)\fR embedded option (see METASYNTAX, below). +.TP 15 +\fB\-linestop\fR +Changes the behavior of `[^' bracket expressions and `.' so that they +stop at newlines. This is the same as specifying the \fB(?p)\fR +embedded option (see METASYNTAX, below). +.TP 15 +\fB\-lineanchor\fR +Changes the behavior of `^' and `$' (the ``anchors'') so they match the +beginning and end of a line respectively. This is the same as +specifying the \fB(?w)\fR embedded option (see METASYNTAX, below). .TP 10 \fB\-nocase\fR Upper-case characters in \fIstring\fR will be converted to lower-case before matching against \fIexp\fR; however, substitutions specified by \fIsubSpec\fR use the original unconverted form of \fIstring\fR. +.VS 8.3 +.TP 10 +\fB\-start\fR \fIindex\fR +Specifies a character index offset into the string to start +matching the regular expression at. When using this switch, `^' +will not match the beginning of the line, and \\A will still +match the start of the string at \fIindex\fR. +\fIindex\fR will be constrained to the bounds of the input string. +.VE 8.3 .TP 10 \fB\-\|\-\fR Marks the end of switches. The argument following this one will @@ -70,3 +107,4 @@ of regular expressions. .SH KEYWORDS match, pattern, regular expression, substitute + |