aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-05-20 17:19:47 +0000
committerRichard M. Stallman2001-05-20 17:19:47 +0000
commit8f17d892d1f19fe8abad4a9d9c2f36cfd09453d5 (patch)
tree97374ff349615c7ae5f4f5563ea6c342c36fe62e
parent65569e52bb33a4bc38c414f562d0a02b58fe8e67 (diff)
downloademacs-8f17d892d1f19fe8abad4a9d9c2f36cfd09453d5.tar.gz
emacs-8f17d892d1f19fe8abad4a9d9c2f36cfd09453d5.zip
Use Lisp escape sequences only inside string syntax.
-rw-r--r--lispref/searching.texi21
1 files changed, 12 insertions, 9 deletions
diff --git a/lispref/searching.texi b/lispref/searching.texi
index e23be33e440..63e4611a6e8 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -311,11 +311,14 @@ matches both @samp{]} and @samp{-}.
311To include @samp{^} in a character alternative, put it anywhere but at 311To include @samp{^} in a character alternative, put it anywhere but at
312the beginning. 312the beginning.
313 313
314The beginning and end of a range of multibyte characters must be in the 314The beginning and end of a range of multibyte characters must be in
315same character set (@pxref{Character Sets}). Thus, @samp{[\x8e0-\x97c]} 315the same character set (@pxref{Character Sets}). Thus,
316is invalid because character 0x8e0 (@samp{a} with grave accent) is in 316@code{"[\x8e0-\x97c]"} is invalid because character 0x8e0 (@samp{a}
317the Emacs character set for Latin-1 but the character 0x97c (@samp{u} 317with grave accent) is in the Emacs character set for Latin-1 but the
318with diaeresis) is in the Emacs character set for Latin-2. 318character 0x97c (@samp{u} with diaeresis) is in the Emacs character
319set for Latin-2. (We use Lisp string syntax to write that example,
320and a few others in the next few paragraphs, in order to include hex
321escape sequences in them.)
319 322
320If a range starts with a unibyte character @var{c} and ends with a 323If a range starts with a unibyte character @var{c} and ends with a
321multibyte character @var{c2}, the range is divided into two parts: one 324multibyte character @var{c2}, the range is divided into two parts: one
@@ -324,10 +327,10 @@ is @samp{@var{c}..?\377}, the other is @samp{@var{c1}..@var{c2}}, where
324belongs. 327belongs.
325 328
326You cannot always match all non-@sc{ascii} characters with the regular 329You cannot always match all non-@sc{ascii} characters with the regular
327expression @samp{[\200-\377]}. This works when searching a unibyte 330expression @code{"[\200-\377]"}. This works when searching a unibyte
328buffer or string (@pxref{Text Representations}), but not in a multibyte 331buffer or string (@pxref{Text Representations}), but not in a multibyte
329buffer or string, because many non-@sc{ascii} characters have codes 332buffer or string, because many non-@sc{ascii} characters have codes
330above octal 0377. However, the regular expression @samp{[^\000-\177]} 333above octal 0377. However, the regular expression @code{"[^\000-\177]"}
331does match all non-@sc{ascii} characters (see below regarding @samp{^}), 334does match all non-@sc{ascii} characters (see below regarding @samp{^}),
332in both multibyte and unibyte representations, because only the 335in both multibyte and unibyte representations, because only the
333@sc{ascii} characters are excluded. 336@sc{ascii} characters are excluded.
@@ -361,7 +364,7 @@ match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at
361the beginning of a line. 364the beginning of a line.
362 365
363When matching a string instead of a buffer, @samp{^} matches at the 366When matching a string instead of a buffer, @samp{^} matches at the
364beginning of the string or after a newline character @samp{\n}. 367beginning of the string or after a newline character.
365 368
366For historical compatibility reasons, @samp{^} can be used only at the 369For historical compatibility reasons, @samp{^} can be used only at the
367beginning of the regular expression, or after @samp{\(} or @samp{\|}. 370beginning of the regular expression, or after @samp{\(} or @samp{\|}.
@@ -373,7 +376,7 @@ is similar to @samp{^} but matches only at the end of a line. Thus,
373@samp{x+$} matches a string of one @samp{x} or more at the end of a line. 376@samp{x+$} matches a string of one @samp{x} or more at the end of a line.
374 377
375When matching a string instead of a buffer, @samp{$} matches at the end 378When matching a string instead of a buffer, @samp{$} matches at the end
376of the string or before a newline character @samp{\n}. 379of the string or before a newline character.
377 380
378For historical compatibility reasons, @samp{$} can be used only at the 381For historical compatibility reasons, @samp{$} can be used only at the
379end of the regular expression, or before @samp{\)} or @samp{\|}. 382end of the regular expression, or before @samp{\)} or @samp{\|}.