summaryrefslogtreecommitdiffstats
path: root/doc/regsub.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/regsub.n')
-rw-r--r--doc/regsub.n7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/regsub.n b/doc/regsub.n
index f3371e6..33a2e6f 100644
--- a/doc/regsub.n
+++ b/doc/regsub.n
@@ -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: regsub.n,v 1.25 2008/09/23 13:22:18 dkf Exp $
+'\" RCS: @(#) $Id: regsub.n,v 1.26 2008/10/17 10:22:25 dkf Exp $
'\"
.so man.macros
.TH regsub n 8.3 Tcl "Tcl Built-In Commands"
@@ -148,24 +148,29 @@ of regular expressions.
.PP
Replace (in the string in variable \fIstring\fR) every instance of
\fBfoo\fR which is a word by itself with \fBbar\fR:
+.PP
.CS
\fBregsub\fR -all {\emfoo\eM} $string bar string
.CE
+.PP
or (using the
.QW "basic regular expression"
syntax):
+.PP
.CS
\fBregsub\fR -all {(?b)\e<foo\e>} $string bar string
.CE
.PP
Insert double-quotes around the first instance of the word
\fBinteresting\fR, however it is capitalized.
+.PP
.CS
\fBregsub\fR -nocase {\eyinteresting\ey} $string {"&"} string
.CE
.PP
Convert all non-ASCII and Tcl-significant characters into \eu escape
sequences by using \fBregsub\fR and \fBsubst\fR in combination:
+.PP
.CS
# This RE is just a character class for everything "bad"
set RE {[][{};#\e\e\e$\es\eu0080-\euffff]}