aboutsummaryrefslogtreecommitdiffstats
path: root/man7/regex.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2012-09-24 10:23:07 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2012-09-24 10:23:07 +0200
commit9f8e673e623dc6fbae517885f4161a29e9c24d1d (patch)
tree640be3c83321e9a56832c4532bf0b1ba780cfba3 /man7/regex.7
parent6c1544c1325437c9d1dc53c73c6c5fe72d3f62b3 (diff)
downloadman-pages-9f8e673e623dc6fbae517885f4161a29e9c24d1d.tar.gz
time.1, atexit.3, bsearch.3, dlopen.3, envz_add.3, errno.3, fmtmsg.3, getgrent_r.3, getline.3, getmntent.3, getnameinfo.3, getpass.3, getpwent_r.3, gets.3, isalpha.3, printf.3, puts.3, recno.3, scandir.3, stdarg.3, sysconf.3, termios.3, wordexp.3, null.4, core.5, dir_colors.5, issue.5, proc.5, termcap.5, utmp.5, ascii.7, cpuset.7, glob.7, man-pages.7, man.7, mdoc.7, mdoc.samples.7, regex.7: Global fix: use \\ rather than \e for literal backslash
Reported-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/regex.7')
-rw-r--r--man7/regex.722
1 files changed, 11 insertions, 11 deletions
diff --git a/man7/regex.7 b/man7/regex.7
index c9355717c8..b7dd627ec1 100644
--- a/man7/regex.7
+++ b/man7/regex.7
@@ -90,16 +90,16 @@ an empty set of "\fI()\fP" (matching the null string)\*(dg,
a \fIbracket expression\fR (see below), \(aq.\(aq
(matching any single character), \(aq^\(aq (matching the null string at the
beginning of a line), \(aq$\(aq (matching the null string at the
-end of a line), a \(aq\e\(aq followed by one of the characters
-"\fI^.[$()|*+?{\e\fP"
+end of a line), a \(aq\\\(aq followed by one of the characters
+"\fI^.[$()|*+?{\\\fP"
(matching that character taken as an ordinary character),
-a \(aq\e\(aq followed by any other character\*(dg
+a \(aq\\\(aq followed by any other character\*(dg
(matching that character taken as an ordinary character,
-as if the \(aq\e\(aq had not been present\*(dg),
+as if the \(aq\\\(aq had not been present\*(dg),
or a single character with no other significance (matching that character).
A \(aq{\(aq followed by a character other than a digit is an ordinary
character, not the beginning of a bound\*(dg.
-It is illegal to end an RE with \(aq\e\(aq.
+It is illegal to end an RE with \(aq\\\(aq.
.PP
A \fIbracket expression\fR is a list of characters enclosed in "\fI[]\fP".
It normally matches any single character from the list (but see below).
@@ -123,7 +123,7 @@ To use a literal \(aq\-\(aq as the first endpoint of a range,
enclose it in "\fI[.\fP" and "\fI.]\fP"
to make it a collating element (see below).
With the exception of these and some combinations using \(aq[\(aq (see next
-paragraphs), all other special characters, including \(aq\e\(aq, lose their
+paragraphs), all other special characters, including \(aq\\\(aq, lose their
special significance within a bracket expression.
.PP
Within a bracket expression, a collating element (a character,
@@ -235,9 +235,9 @@ Obsolete ("basic") regular expressions differ in several respects.
\(aq|\(aq, \(aq+\(aq, and \(aq?\(aq are
ordinary characters and there is no equivalent
for their functionality.
-The delimiters for bounds are "\fI\e{\fP" and "\fI\e}\fP",
+The delimiters for bounds are "\fI\\{\fP" and "\fI\\}\fP",
with \(aq{\(aq and \(aq}\(aq by themselves ordinary characters.
-The parentheses for nested subexpressions are "\fI\e(\fP" and "\fI\e)\fP",
+The parentheses for nested subexpressions are "\fI\\(\fP" and "\fI\\)\fP",
with \(aq(\(aq and \(aq)\(aq by themselves ordinary characters.
\(aq^\(aq is an ordinary character except at the beginning of the
RE or\*(dg the beginning of a parenthesized subexpression,
@@ -248,12 +248,12 @@ RE or the beginning of a parenthesized subexpression
(after a possible leading \(aq^\(aq).
.PP
Finally, there is one new type of atom, a \fIback reference\fR:
-\(aq\e\(aq followed by a nonzero decimal digit \fId\fR
+\(aq\\\(aq followed by a nonzero decimal digit \fId\fR
matches the same sequence of characters
matched by the \fId\fRth parenthesized subexpression
(numbering subexpressions by the positions of their opening parentheses,
left to right),
-so that, for example, "\fI\e([bc]\e)\e1\fP" matches "bb" or "cc" but not "bc".
+so that, for example, "\fI\\([bc]\\)\\1\fP" matches "bb" or "cc" but not "bc".
.SH BUGS
Having two kinds of REs is a botch.
.PP
@@ -267,7 +267,7 @@ Back references are a dreadful botch,
posing major problems for efficient implementations.
They are also somewhat vaguely defined
(does
-"\fIa\e(\e(b\e)*\e2\e)*d\fP" match "abbbd"?).
+"\fIa\\(\\(b\\)*\\2\\)*d\fP" match "abbbd"?).
Avoid using them.
.PP
POSIX.2's specification of case-independent matching is vague.