aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-11-06 23:21:01 +0100
committerStefan Kangas2022-11-06 23:21:01 +0100
commit61d55ce3bb4dc1f7deac552439c61bbe0909dcdb (patch)
treee8dd99405ac50de77f19d32b395c7bad6ac61c7a
parent8fe62b2ab571ba313587e8543006eca03ff36025 (diff)
parent70fb03a49af07bd644e831c7d2e8d219aa910535 (diff)
downloademacs-61d55ce3bb4dc1f7deac552439c61bbe0909dcdb.tar.gz
emacs-61d55ce3bb4dc1f7deac552439c61bbe0909dcdb.zip
Merge from origin/emacs-28
70fb03a49a ; * doc/emacs/search.texi (Lax Search): Improve suggestion... 5779df0c5b ; * doc/lispref/searching.texi: Remove reference to Posix.... 46929f6b73 ; Improve documentation of character classes in regexps
-rw-r--r--doc/emacs/search.texi2
-rw-r--r--doc/lispref/searching.texi39
2 files changed, 25 insertions, 16 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 0090bc34005..63541d78a5a 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -1359,7 +1359,7 @@ Hence, @w{@samp{foo bar}} matches @w{@samp{foo bar}}, @w{@samp{foo@ @
1359bar}}, @w{@samp{foo@ @ @ bar}}, and so on (but not @samp{foobar}). If 1359bar}}, @w{@samp{foo@ @ @ bar}}, and so on (but not @samp{foobar}). If
1360you want to make spaces match sequences of newlines as well as spaces 1360you want to make spaces match sequences of newlines as well as spaces
1361and tabs, customize the option to make its value be the regular 1361and tabs, customize the option to make its value be the regular
1362expression @samp{[[:space:]\n]+}. (The default behavior of the 1362expression @samp{[ \t\n]+}. (The default behavior of the
1363incremental regexp search is different; see @ref{Regexp Search}.) 1363incremental regexp search is different; see @ref{Regexp Search}.)
1364 1364
1365 If you want whitespace characters to match exactly, you can turn lax 1365 If you want whitespace characters to match exactly, you can turn lax
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 743718b560f..ad7f2856de8 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -395,13 +395,12 @@ range should not be the starting point of another one; for example,
395@samp{[a-m-z]} should be avoided. 395@samp{[a-m-z]} should be avoided.
396 396
397A character alternative can also specify named character classes 397A character alternative can also specify named character classes
398(@pxref{Char Classes}). This is a POSIX feature. For example, 398(@pxref{Char Classes}). For example, @samp{[[:ascii:]]} matches any
399@samp{[[:ascii:]]} matches any @acronym{ASCII} character. 399@acronym{ASCII} character. Using a character class is equivalent to
400Using a character class is equivalent to mentioning each of the 400mentioning each of the characters in that class; but the latter is not
401characters in that class; but the latter is not feasible in practice, 401feasible in practice, since some classes include thousands of
402since some classes include thousands of different characters. 402different characters. A character class should not appear as the
403A character class should not appear as the lower or upper bound 403lower or upper bound of a range.
404of a range.
405 404
406The usual regexp special characters are not special inside a 405The usual regexp special characters are not special inside a
407character alternative. A completely different set of characters is 406character alternative. A completely different set of characters is
@@ -617,7 +616,7 @@ This matches any character whose code is in the range 0--31.
617This matches @samp{0} through @samp{9}. Thus, @samp{[-+[:digit:]]} 616This matches @samp{0} through @samp{9}. Thus, @samp{[-+[:digit:]]}
618matches any digit, as well as @samp{+} and @samp{-}. 617matches any digit, as well as @samp{+} and @samp{-}.
619@item [:graph:] 618@item [:graph:]
620This matches graphic characters---everything except whitespace, 619This matches graphic characters---everything except spaces,
621@acronym{ASCII} and non-@acronym{ASCII} control characters, 620@acronym{ASCII} and non-@acronym{ASCII} control characters,
622surrogates, and codepoints unassigned by Unicode, as indicated by the 621surrogates, and codepoints unassigned by Unicode, as indicated by the
623Unicode @samp{general-category} property (@pxref{Character 622Unicode @samp{general-category} property (@pxref{Character
@@ -625,29 +624,39 @@ Properties}).
625@item [:lower:] 624@item [:lower:]
626This matches any lower-case letter, as determined by the current case 625This matches any lower-case letter, as determined by the current case
627table (@pxref{Case Tables}). If @code{case-fold-search} is 626table (@pxref{Case Tables}). If @code{case-fold-search} is
628non-@code{nil}, this also matches any upper-case letter. 627non-@code{nil}, this also matches any upper-case letter. Note that a
628buffer can have its own local case table different from the default
629one.
629@item [:multibyte:] 630@item [:multibyte:]
630This matches any multibyte character (@pxref{Text Representations}). 631This matches any multibyte character (@pxref{Text Representations}).
631@item [:nonascii:] 632@item [:nonascii:]
632This matches any non-@acronym{ASCII} character. 633This matches any non-@acronym{ASCII} character.
633@item [:print:] 634@item [:print:]
634This matches any printing character---either whitespace, or a graphic 635This matches any printing character---either spaces or graphic
635character matched by @samp{[:graph:]}. 636characters matched by @samp{[:graph:]}.
636@item [:punct:] 637@item [:punct:]
637This matches any punctuation character. (At present, for multibyte 638This matches any punctuation character. (At present, for multibyte
638characters, it matches anything that has non-word syntax.) 639characters, it matches anything that has non-word syntax, and thus its
640exact definition can vary from one major mode to another, since the
641syntax of a character depends on the major mode.)
639@item [:space:] 642@item [:space:]
640This matches any character that has whitespace syntax 643This matches any character that has whitespace syntax
641(@pxref{Syntax Class Table}). 644(@pxref{Syntax Class Table}). Note that the syntax of a character,
645and thus which characters are considered ``whitespace'',
646depends on the major mode.
642@item [:unibyte:] 647@item [:unibyte:]
643This matches any unibyte character (@pxref{Text Representations}). 648This matches any unibyte character (@pxref{Text Representations}).
644@item [:upper:] 649@item [:upper:]
645This matches any upper-case letter, as determined by the current case 650This matches any upper-case letter, as determined by the current case
646table (@pxref{Case Tables}). If @code{case-fold-search} is 651table (@pxref{Case Tables}). If @code{case-fold-search} is
647non-@code{nil}, this also matches any lower-case letter. 652non-@code{nil}, this also matches any lower-case letter. Note that a
653buffer can have its own local case table different from the default
654one.
648@item [:word:] 655@item [:word:]
649This matches any character that has word syntax (@pxref{Syntax Class 656This matches any character that has word syntax (@pxref{Syntax Class
650Table}). 657Table}). Note that the syntax of a character, and thus which
658characters are considered ``word-constituent'', depends on the major
659mode.
651@item [:xdigit:] 660@item [:xdigit:]
652This matches the hexadecimal digits: @samp{0} through @samp{9}, @samp{a} 661This matches the hexadecimal digits: @samp{0} through @samp{9}, @samp{a}
653through @samp{f} and @samp{A} through @samp{F}. 662through @samp{f} and @samp{A} through @samp{F}.