diff options
Diffstat (limited to 'man7/regex.7')
| -rw-r--r-- | man7/regex.7 | 22 |
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. |
