aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-08-11 19:51:56 +0000
committerRichard M. Stallman2005-08-11 19:51:56 +0000
commitc118d09e26efd5263892492fe168020f8cea094f (patch)
tree505bce0af537b745475cd0f0af9103f6d923c4fa
parentb95a0c80ae0397d4487058bd01d5aa1da87c4f4c (diff)
downloademacs-c118d09e26efd5263892492fe168020f8cea094f.tar.gz
emacs-c118d09e26efd5263892492fe168020f8cea094f.zip
(Regexp Backslash, Regexp Example): New nodes split out of Regexps.
-rw-r--r--lispref/ChangeLog13
-rw-r--r--man/search.texi50
2 files changed, 33 insertions, 30 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 0e28b7b2168..600da8aaf5f 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,16 @@
12005-08-11 Richard M. Stallman <rms@gnu.org>
2
3 * tips.texi (Key Binding Conventions, Programming Tips, Warning Tips):
4 New nodes split out of Coding Conventions.
5
6 * searching.texi (Regular Expressions): Document re-builder.
7
8 * os.texi (Time Parsing): New node split out of Time Conversion.
9
10 * processes.texi (Misc Network, Network Feature Testing)
11 (Network Options, Make Network): New nodes split out of
12 Low-Level Network.
13
12005-08-09 Richard M. Stallman <rms@gnu.org> 142005-08-09 Richard M. Stallman <rms@gnu.org>
2 15
3 * frames.texi (Geometry): New node, split from Size and Position. 16 * frames.texi (Geometry): New node, split from Size and Position.
diff --git a/man/search.texi b/man/search.texi
index a849e7dc1f5..f362e8e769e 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -24,6 +24,8 @@ asks interactively which occurrences to replace.
24* Word Search:: Search for sequence of words. 24* Word Search:: Search for sequence of words.
25* Regexp Search:: Search for match for a regexp. 25* Regexp Search:: Search for match for a regexp.
26* Regexps:: Syntax of regular expressions. 26* Regexps:: Syntax of regular expressions.
27* Regexp Backslash:: Regular expression constructs starting with `\'.
28* Regexp Example:: A complex regular expression explained.
27* Search Case:: To ignore case while searching, or not. 29* Search Case:: To ignore case while searching, or not.
28* Replace:: Search, and replace some or all matches. 30* Replace:: Search, and replace some or all matches.
29* Other Repeating Search:: Operating on all matches for some regexp. 31* Other Repeating Search:: Operating on all matches for some regexp.
@@ -669,20 +671,26 @@ has two functions: it quotes the special characters (including
669Because @samp{\} quotes special characters, @samp{\$} is a regular 671Because @samp{\} quotes special characters, @samp{\$} is a regular
670expression that matches only @samp{$}, and @samp{\[} is a regular 672expression that matches only @samp{$}, and @samp{\[} is a regular
671expression that matches only @samp{[}, and so on. 673expression that matches only @samp{[}, and so on.
674
675See the following section for the special constructs that begin
676with @samp{\}.
672@end table 677@end table
673 678
674Note: for historical compatibility, special characters are treated as 679 Note: for historical compatibility, special characters are treated as
675ordinary ones if they are in contexts where their special meanings make no 680ordinary ones if they are in contexts where their special meanings make no
676sense. For example, @samp{*foo} treats @samp{*} as ordinary since there is 681sense. For example, @samp{*foo} treats @samp{*} as ordinary since there is
677no preceding expression on which the @samp{*} can act. It is poor practice 682no preceding expression on which the @samp{*} can act. It is poor practice
678to depend on this behavior; it is better to quote the special character anyway, 683to depend on this behavior; it is better to quote the special character anyway,
679regardless of where it appears.@refill 684regardless of where it appears.
685
686@node Regexp Backslash
687@section Backslash in Regular Expressions
680 688
681For the most part, @samp{\} followed by any character matches only that 689 For the most part, @samp{\} followed by any character matches only
682character. However, there are several exceptions: two-character 690that character. However, there are several exceptions: two-character
683sequences starting with @samp{\} that have special meanings. The second 691sequences starting with @samp{\} that have special meanings. The
684character in the sequence is always an ordinary character when used on 692second character in the sequence is always an ordinary character when
685its own. Here is a table of @samp{\} constructs. 693used on its own. Here is a table of @samp{\} constructs.
686 694
687@table @kbd 695@table @kbd
688@item \| 696@item \|
@@ -836,8 +844,11 @@ matches any character that does @emph{not} belong to category
836 The constructs that pertain to words and syntax are controlled by the 844 The constructs that pertain to words and syntax are controlled by the
837setting of the syntax table (@pxref{Syntax}). 845setting of the syntax table (@pxref{Syntax}).
838 846
839 Here is a complicated regexp. It is a simplified version of the 847@node Regexp Example
840regexp that Emacs uses, by default, to recognize the end of a sentence 848@section Regular Expression Example
849
850 Here is a complicated regexp---a simplified version of the regexp
851that Emacs uses, by default, to recognize the end of a sentence
841together with any whitespace that follows. We show its Lisp syntax to 852together with any whitespace that follows. We show its Lisp syntax to
842distinguish the spaces from the tab characters. In Lisp syntax, the 853distinguish the spaces from the tab characters. In Lisp syntax, the
843string constant begins and ends with a double-quote. @samp{\"} stands 854string constant begins and ends with a double-quote. @samp{\"} stands
@@ -864,27 +875,6 @@ for Lisp syntax. In commands that use ordinary minibuffer input to
864read a regexp, you would quote the @kbd{C-j} by preceding it with a 875read a regexp, you would quote the @kbd{C-j} by preceding it with a
865@kbd{C-q} to prevent @kbd{C-j} from exiting the minibuffer. 876@kbd{C-q} to prevent @kbd{C-j} from exiting the minibuffer.
866 877
867@ignore
868@c I commented this out because it is missing vital information
869@c and therefore useless. For instance, what do you do to *use* the
870@c regular expression when it is finished? What jobs is this good for?
871@c -- rms
872
873@findex re-builder
874@cindex authoring regular expressions
875 For convenient interactive development of regular expressions, you
876can use the @kbd{M-x re-builder} command. It provides a convenient
877interface for creating regular expressions, by giving immediate visual
878feedback. The buffer from which @code{re-builder} was invoked becomes
879the target for the regexp editor, which pops in a separate window. At
880all times, all the matches in the target buffer for the current
881regular expression are highlighted. Each parenthesized sub-expression
882of the regexp is shown in a distinct face, which makes it easier to
883verify even very complex regexps. (On displays that don't support
884colors, Emacs blinks the cursor around the matched text, as it does
885for matching parens.)
886@end ignore
887
888@node Search Case 878@node Search Case
889@section Searching and Case 879@section Searching and Case
890 880