diff options
| author | Richard M. Stallman | 2001-05-20 17:19:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-05-20 17:19:47 +0000 |
| commit | 8f17d892d1f19fe8abad4a9d9c2f36cfd09453d5 (patch) | |
| tree | 97374ff349615c7ae5f4f5563ea6c342c36fe62e | |
| parent | 65569e52bb33a4bc38c414f562d0a02b58fe8e67 (diff) | |
| download | emacs-8f17d892d1f19fe8abad4a9d9c2f36cfd09453d5.tar.gz emacs-8f17d892d1f19fe8abad4a9d9c2f36cfd09453d5.zip | |
Use Lisp escape sequences only inside string syntax.
| -rw-r--r-- | lispref/searching.texi | 21 |
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{-}. | |||
| 311 | To include @samp{^} in a character alternative, put it anywhere but at | 311 | To include @samp{^} in a character alternative, put it anywhere but at |
| 312 | the beginning. | 312 | the beginning. |
| 313 | 313 | ||
| 314 | The beginning and end of a range of multibyte characters must be in the | 314 | The beginning and end of a range of multibyte characters must be in |
| 315 | same character set (@pxref{Character Sets}). Thus, @samp{[\x8e0-\x97c]} | 315 | the same character set (@pxref{Character Sets}). Thus, |
| 316 | is invalid because character 0x8e0 (@samp{a} with grave accent) is in | 316 | @code{"[\x8e0-\x97c]"} is invalid because character 0x8e0 (@samp{a} |
| 317 | the Emacs character set for Latin-1 but the character 0x97c (@samp{u} | 317 | with grave accent) is in the Emacs character set for Latin-1 but the |
| 318 | with diaeresis) is in the Emacs character set for Latin-2. | 318 | character 0x97c (@samp{u} with diaeresis) is in the Emacs character |
| 319 | set for Latin-2. (We use Lisp string syntax to write that example, | ||
| 320 | and a few others in the next few paragraphs, in order to include hex | ||
| 321 | escape sequences in them.) | ||
| 319 | 322 | ||
| 320 | If a range starts with a unibyte character @var{c} and ends with a | 323 | If a range starts with a unibyte character @var{c} and ends with a |
| 321 | multibyte character @var{c2}, the range is divided into two parts: one | 324 | multibyte 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 | |||
| 324 | belongs. | 327 | belongs. |
| 325 | 328 | ||
| 326 | You cannot always match all non-@sc{ascii} characters with the regular | 329 | You cannot always match all non-@sc{ascii} characters with the regular |
| 327 | expression @samp{[\200-\377]}. This works when searching a unibyte | 330 | expression @code{"[\200-\377]"}. This works when searching a unibyte |
| 328 | buffer or string (@pxref{Text Representations}), but not in a multibyte | 331 | buffer or string (@pxref{Text Representations}), but not in a multibyte |
| 329 | buffer or string, because many non-@sc{ascii} characters have codes | 332 | buffer or string, because many non-@sc{ascii} characters have codes |
| 330 | above octal 0377. However, the regular expression @samp{[^\000-\177]} | 333 | above octal 0377. However, the regular expression @code{"[^\000-\177]"} |
| 331 | does match all non-@sc{ascii} characters (see below regarding @samp{^}), | 334 | does match all non-@sc{ascii} characters (see below regarding @samp{^}), |
| 332 | in both multibyte and unibyte representations, because only the | 335 | in 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 | |||
| 361 | the beginning of a line. | 364 | the beginning of a line. |
| 362 | 365 | ||
| 363 | When matching a string instead of a buffer, @samp{^} matches at the | 366 | When matching a string instead of a buffer, @samp{^} matches at the |
| 364 | beginning of the string or after a newline character @samp{\n}. | 367 | beginning of the string or after a newline character. |
| 365 | 368 | ||
| 366 | For historical compatibility reasons, @samp{^} can be used only at the | 369 | For historical compatibility reasons, @samp{^} can be used only at the |
| 367 | beginning of the regular expression, or after @samp{\(} or @samp{\|}. | 370 | beginning 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 | ||
| 375 | When matching a string instead of a buffer, @samp{$} matches at the end | 378 | When matching a string instead of a buffer, @samp{$} matches at the end |
| 376 | of the string or before a newline character @samp{\n}. | 379 | of the string or before a newline character. |
| 377 | 380 | ||
| 378 | For historical compatibility reasons, @samp{$} can be used only at the | 381 | For historical compatibility reasons, @samp{$} can be used only at the |
| 379 | end of the regular expression, or before @samp{\)} or @samp{\|}. | 382 | end of the regular expression, or before @samp{\)} or @samp{\|}. |