[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master c569cce: * doc: Recommend putting '-' as last char
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master c569cce: * doc: Recommend putting '-' as last char in Emacs charset regexps |
Date: |
Thu, 21 Mar 2019 08:27:47 -0400 (EDT) |
branch: master
commit c569cceb2d334564d320d2b4098c855db7eb88a0
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* doc: Recommend putting '-' as last char in Emacs charset regexps
* doc/lispref/searching.texi (Regexp Special):
* doc/emacs/search.texi (Regexps): Recommend - as last char in [...].
---
doc/emacs/search.texi | 9 ++++-----
doc/lispref/searching.texi | 14 +++++++-------
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 9c58ef4..a1c987c 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -974,11 +974,10 @@ character class inside a character alternative. For
instance,
elisp, The Emacs Lisp Reference Manual}, for a list of character
classes.
-To include a @samp{]} in a character set, you must make it the first
-character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To
-include a @samp{-}, write @samp{-} as the first or last character of the
-set, or put it after a range. Thus, @samp{[]-]} matches both @samp{]}
-and @samp{-}.
+To include a @samp{]} in a character set, you must make it the first character.
+For example, @samp{[]a]} matches @samp{]} or @samp{a}. To include a @samp{-},
+write @samp{-} as the last character of the set, tho you can also put it first
+or after a range. Thus, @samp{[]-]} matches both @samp{]} and @samp{-}.
To include @samp{^} in a set, put it anywhere but at the beginning of
the set. (At the beginning, it complements the set---see below.)
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 740be2a..0f31291 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -406,13 +406,13 @@ Note also that the usual regexp special characters are
not special inside a
character alternative. A completely different set of characters is
special inside character alternatives: @samp{]}, @samp{-} and @samp{^}.
-To include a @samp{]} in a character alternative, you must make it the
-first character. For example, @samp{[]a]} matches @samp{]} or @samp{a}.
-To include a @samp{-}, write @samp{-} as the first or last character of
-the character alternative, or put it after a range. Thus, @samp{[]-]}
-matches both @samp{]} and @samp{-}. (As explained below, you cannot
-use @samp{\]} to include a @samp{]} inside a character alternative,
-since @samp{\} is not special there.)
+To include a @samp{]} in a character alternative, you must make it the first
+character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To include
+a @samp{-}, write @samp{-} as the last character of the character alternative,
+tho you can also put it first or after a range. Thus, @samp{[]-]} matches both
address@hidden and @samp{-}. (As explained below, you cannot use @samp{\]} to
+include a @samp{]} inside a character alternative, since @samp{\} is not
+special there.)
To include @samp{^} in a character alternative, put it anywhere but at
the beginning.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master c569cce: * doc: Recommend putting '-' as last char in Emacs charset regexps,
Stefan Monnier <=