diff options
author | dgp <dgp@users.sourceforge.net> | 2017-06-23 13:09:23 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-06-23 13:09:23 (GMT) |
commit | 5bf26c2a0b6c22fc86b985d78527fba48650f1b6 (patch) | |
tree | a8a1259af2f72a712482c154e3d9b6ce8eb3cae3 /doc | |
parent | ad64b08c4f3fc6ee6c6f3247c8a56d8b45136eca (diff) | |
download | tcl-5bf26c2a0b6c22fc86b985d78527fba48650f1b6.zip tcl-5bf26c2a0b6c22fc86b985d78527fba48650f1b6.tar.gz tcl-5bf26c2a0b6c22fc86b985d78527fba48650f1b6.tar.bz2 |
Rewrite the documentation of [regsub -command] so it's not quite such a mess.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/regsub.n | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/regsub.n b/doc/regsub.n index 23bbff9..29c118a 100644 --- a/doc/regsub.n +++ b/doc/regsub.n @@ -70,18 +70,20 @@ from the corresponding match. .TP \fB\-command\fR .VS 8.7 -Changes the handling of the substitution string so that it no longer treats +Changes the handling of \fIsubSpec\fR so that it is not treated +as a template for a substitution string and the substrings .QW & and -.QW \e -as special characters, but instead uses them as a non-empty list of words. -Each time a substitution is processed, another complete Tcl word is appended -to that list for each substitution value (the first such argument represents -the overall matched substring, the subsequent arguments will be one per -capturing sub-RE, much as are returned from \fBregexp\fR \fB\-inline\fR) and -the overall list is then evaluated as a Tcl command call. If the command -finishes successfully, the result of command call is substituted into the -resulting string. +.QW \e\fIn\fR +no longer have special meaning. Instead \fIsubSpec\fR must be a +command prefix, that is, a non-empty list. The substring of \fIstring\fR +that matches \fIexp\fR, and then each substring that matches each +capturing sub-RE within \fIexp\fR are appended as additional elements +to that list. (The items appended to the list are much like what +\fBregexp\fR \fB-inline\fR would return). The completed list is then +evaluated as a Tcl command, and the result of that command is the +substitution string. Any error or exception from command evaluation +becomes an error or exception from the \fBregsub\fR command. .RS .PP If \fB\-all\fR is not also given, the command callback will be invoked at most |