diff options
| author | Eli Zaretskii | 2021-05-30 13:20:02 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-05-30 13:20:02 +0300 |
| commit | 5dfa5e26dd58c6e8aa135c81ecfdbda92725556e (patch) | |
| tree | 626326cecd538891a8aaa8fa759dffc47542626b | |
| parent | 30e5d93ee1b938c207c4f5ec015ba2633cf423cd (diff) | |
| download | emacs-5dfa5e26dd58c6e8aa135c81ecfdbda92725556e.tar.gz emacs-5dfa5e26dd58c6e8aa135c81ecfdbda92725556e.zip | |
Improve documentation of regexp ranges
* doc/lispref/searching.texi (Regexp Special): Document the effect
of using octal escapes in regexp ranges. (Bug#17758)
| -rw-r--r-- | doc/lispref/searching.texi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 8b900da616f..1ee4be7dd13 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -363,7 +363,7 @@ preceding expression either once or not at all. For example, | |||
| 363 | @anchor{Non-greedy repetition} | 363 | @anchor{Non-greedy repetition} |
| 364 | @item @samp{*?}, @samp{+?}, @samp{??} | 364 | @item @samp{*?}, @samp{+?}, @samp{??} |
| 365 | @cindex non-greedy repetition characters in regexp | 365 | @cindex non-greedy repetition characters in regexp |
| 366 | These are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+} | 366 | are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+} |
| 367 | and @samp{?}. Where those operators match the largest possible | 367 | and @samp{?}. Where those operators match the largest possible |
| 368 | substring (consistent with matching the entire containing expression), | 368 | substring (consistent with matching the entire containing expression), |
| 369 | the non-greedy variants match the smallest possible substring | 369 | the non-greedy variants match the smallest possible substring |
| @@ -438,6 +438,13 @@ including newline. However, a reversed range should always be from | |||
| 438 | the letter @samp{z} to the letter @samp{a} to make it clear that it is | 438 | the letter @samp{z} to the letter @samp{a} to make it clear that it is |
| 439 | not a typo; for example, @samp{[+-*/]} should be avoided, because it | 439 | not a typo; for example, @samp{[+-*/]} should be avoided, because it |
| 440 | matches only @samp{/} rather than the likely-intended four characters. | 440 | matches only @samp{/} rather than the likely-intended four characters. |
| 441 | |||
| 442 | @item | ||
| 443 | If the end points of a range are raw 8-bit bytes (@pxref{Text | ||
| 444 | Representations}), or if the range start is ASCII and the end is a raw | ||
| 445 | byte (as in @samp{[a-\377]}), the range will match only ASCII | ||
| 446 | characters and raw 8-bit bytes, but not non-ASCII characters. This | ||
| 447 | feature is intended for searching text in unibyte buffers and strings. | ||
| 441 | @end enumerate | 448 | @end enumerate |
| 442 | 449 | ||
| 443 | Some kinds of character alternatives are not the best style even | 450 | Some kinds of character alternatives are not the best style even |