summaryrefslogtreecommitdiffstats
path: root/doc/regexp.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-10-24 14:29:35 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-10-24 14:29:35 (GMT)
commitf78fd9556a52ef9c7737df64e1d37f1ab5ba9746 (patch)
treefec73cd4bb84dace903da378ecd214cb13da4181 /doc/regexp.n
parenta796f06789efc26f57bf30fd83ed98762f97ad30 (diff)
downloadtcl-f78fd9556a52ef9c7737df64e1d37f1ab5ba9746.zip
tcl-f78fd9556a52ef9c7737df64e1d37f1ab5ba9746.tar.gz
tcl-f78fd9556a52ef9c7737df64e1d37f1ab5ba9746.tar.bz2
Lots of improvements to look and feel of manual pages
Diffstat (limited to 'doc/regexp.n')
-rw-r--r--doc/regexp.n39
1 files changed, 27 insertions, 12 deletions
diff --git a/doc/regexp.n b/doc/regexp.n
index 3e4ecce..99e75f3 100644
--- a/doc/regexp.n
+++ b/doc/regexp.n
@@ -4,7 +4,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.n,v 1.19 2005/05/10 18:34:02 kennykb Exp $
+'\" RCS: @(#) $Id: regexp.n,v 1.20 2007/10/24 14:29:39 dkf Exp $
'\"
.so man.macros
.TH regexp n 8.3 Tcl "Tcl Built-In Commands"
@@ -12,7 +12,6 @@
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
regexp \- Match a regular expression against a string
-
.SH SYNOPSIS
\fBregexp \fR?\fIswitches\fR? \fIexp string \fR?\fImatchVar\fR? ?\fIsubMatchVar subMatchVar ...\fR?
.BE
@@ -62,20 +61,37 @@ range of characters.
\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, `^'
+flag,
+.QW [^
+bracket expressions and
+.QW .
+never match newline,
+.QW ^
matches an empty string after any newline in addition to its normal
-function, and `$' matches an empty string before any newline in
+function, and
+.QW $
+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 the \fBre_syntax\fR manual page).
.TP 15
\fB\-linestop\fR
-Changes the behavior of `[^' bracket expressions and `.' so that they
+Changes the behavior of
+.QW [^
+bracket expressions and
+.QW .
+so that they
stop at newlines. This is the same as specifying the \fB(?p)\fR
embedded option (see the \fBre_syntax\fR manual page).
.TP 15
\fB\-lineanchor\fR
-Changes the behavior of `^' and `$' (the ``anchors'') so they match the
+Changes the behavior of
+.QW ^
+and
+.QW $
+(the
+.QW 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 the \fBre_syntax\fR
manual page).
@@ -112,7 +128,8 @@ matching the regular expression at.
The \fIindex\fR value is interpreted in the same manner
as the \fIindex\fR argument to \fBstring index\fR.
.VE 8.5
-When using this switch, `^'
+When using this switch,
+.QW ^
will not match the beginning of the line, and \\A will still
match the start of the string at \fIindex\fR. If \fB\-indices\fR
is specified, the indices will be indexed starting from the
@@ -127,8 +144,9 @@ If there are more \fIsubMatchVar\fR's than parenthesized
subexpressions within \fIexp\fR, or if a particular subexpression
in \fIexp\fR doesn't match the string (e.g. because it was in a
portion of the expression that wasn't matched), then the corresponding
-\fIsubMatchVar\fR will be set to ``\fB\-1 \-1\fR'' if \fB\-indices\fR
-has been specified or to an empty string otherwise.
+\fIsubMatchVar\fR will be set to
+.QW "\fB\-1 \-1\fR"
+if \fB\-indices\fR has been specified or to an empty string otherwise.
.SH EXAMPLES
Find the first occurrence of a word starting with \fBfoo\fR in a
string that is not actually an instance of \fBfoobar\fR, and get the
@@ -156,13 +174,10 @@ characters) in a string:
.CS
\fBregexp\fR \-all \-inline {\\S+} $string
.CE
-
.SH "SEE ALSO"
re_syntax(n), regsub(n),
.VS 8.5
string(n)
.VE
-
-
.SH KEYWORDS
match, regular expression, string