[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/man/search.texi
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/man/search.texi |
Date: |
Fri, 04 Apr 2003 01:23:37 -0500 |
Index: emacs/man/search.texi
diff -c emacs/man/search.texi:1.37 emacs/man/search.texi:1.38
*** emacs/man/search.texi:1.37 Sun Nov 24 14:07:46 2002
--- emacs/man/search.texi Wed Feb 26 04:55:45 2003
***************
*** 413,426 ****
the string @samp{fo}. Still trivial. To do something nontrivial, you
need to use one of the special characters. Here is a list of them.
! @table @kbd
! @item .@: @r{(Period)}
is a special character that matches any single character except a newline.
Using concatenation, we can make regular expressions like @samp{a.b}, which
matches any three-character string that begins with @samp{a} and ends with
@address@hidden
! @item *
is not a construct by itself; it is a postfix operator that means to
match the preceding regular expression repetitively as many times as
possible. Thus, @samp{o*} matches any number of @samp{o}s (including no
--- 413,426 ----
the string @samp{fo}. Still trivial. To do something nontrivial, you
need to use one of the special characters. Here is a list of them.
! @table @asis
! @item @kbd{.}@: @r{(Period)}
is a special character that matches any single character except a newline.
Using concatenation, we can make regular expressions like @samp{a.b}, which
matches any three-character string that begins with @samp{a} and ends with
@address@hidden
! @item @kbd{*}
is not a construct by itself; it is a postfix operator that means to
match the preceding regular expression repetitively as many times as
possible. Thus, @samp{o*} matches any number of @samp{o}s (including no
***************
*** 441,458 ****
The next alternative is for @samp{a*} to match only two @samp{a}s.
With this choice, the rest of the regexp matches address@hidden
! @item +
is a postfix operator, similar to @samp{*} except that it must match
the preceding expression at least once. So, for example, @samp{ca+r}
matches the strings @samp{car} and @samp{caaaar} but not the string
@samp{cr}, whereas @samp{ca*r} matches all three strings.
! @item ?
is a postfix operator, similar to @samp{*} except that it can match the
preceding expression either once or not at all. For example,
@samp{ca?r} matches @samp{car} or @samp{cr}; nothing else.
! @item *?, +?, ??
@cindex non-greedy regexp matching
are non-greedy variants of the operators above. The normal operators
@samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as
--- 441,458 ----
The next alternative is for @samp{a*} to match only two @samp{a}s.
With this choice, the rest of the regexp matches address@hidden
! @item @kbd{+}
is a postfix operator, similar to @samp{*} except that it must match
the preceding expression at least once. So, for example, @samp{ca+r}
matches the strings @samp{car} and @samp{caaaar} but not the string
@samp{cr}, whereas @samp{ca*r} matches all three strings.
! @item @kbd{?}
is a postfix operator, similar to @samp{*} except that it can match the
preceding expression either once or not at all. For example,
@samp{ca?r} matches @samp{car} or @samp{cr}; nothing else.
! @item @kbd{*?}, @kbd{+?}, @kbd{??}
@cindex non-greedy regexp matching
are non-greedy variants of the operators above. The normal operators
@samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as
***************
*** 473,485 ****
a newline, it matches the whole string. Since it @emph{can} match
starting at the first @samp{a}, it does.
! @item address@hidden@address@hidden
is a postfix operator that specifies repetition @var{n} times---that
is, the preceding regular expression must match exactly @var{n} times
in a row. For example, @address@hidden@}} matches the string @samp{xxxx}
and nothing else.
! @item address@hidden@var{n},@address@hidden
is a postfix operator that specifies repetition between @var{n} and
@var{m} times---that is, the preceding regular expression must match
at least @var{n} times, but no more than @var{m} times. If @var{m} is
--- 473,485 ----
a newline, it matches the whole string. Since it @emph{can} match
starting at the first @samp{a}, it does.
! @item @address@hidden@address@hidden
is a postfix operator that specifies repetition @var{n} times---that
is, the preceding regular expression must match exactly @var{n} times
in a row. For example, @address@hidden@}} matches the string @samp{xxxx}
and nothing else.
! @item @address@hidden@var{n},@address@hidden
is a postfix operator that specifies repetition between @var{n} and
@var{m} times---that is, the preceding regular expression must match
at least @var{n} times, but no more than @var{m} times. If @var{m} is
***************
*** 488,494 ****
equivalent to @samp{?}. @* @address@hidden,address@hidden is equivalent to
@samp{*}. @* @address@hidden,address@hidden is equivalent to @samp{+}.
! @item [ @dots{} ]
is a @dfn{character set}, which begins with @samp{[} and is terminated
by @samp{]}. In the simplest case, the characters between the two
brackets are what this set can match.
--- 488,494 ----
equivalent to @samp{?}. @* @address@hidden,address@hidden is equivalent to
@samp{*}. @* @address@hidden,address@hidden is equivalent to @samp{+}.
! @item @kbd{[ @dots{} ]}
is a @dfn{character set}, which begins with @samp{[} and is terminated
by @samp{]}. In the simplest case, the characters between the two
brackets are what this set can match.
***************
*** 523,529 ****
be non-letters. The behavior of a mixed-case range such as @samp{A-z}
is somewhat ill-defined, and it may change in future Emacs versions.
! @item [^ @dots{} ]
@samp{[^} begins a @dfn{complemented character set}, which matches any
character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches
all characters @emph{except} ASCII letters and digits.
--- 523,529 ----
be non-letters. The behavior of a mixed-case range such as @samp{A-z}
is somewhat ill-defined, and it may change in future Emacs versions.
! @item @kbd{[^ @dots{} ]}
@samp{[^} begins a @dfn{complemented character set}, which matches any
character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches
all characters @emph{except} ASCII letters and digits.
***************
*** 536,552 ****
mentioned as one of the characters not to match. This is in contrast to
the handling of regexps in programs such as @code{grep}.
! @item ^
is a special character that matches the empty string, but only at the
beginning of a line in the text being matched. Otherwise it fails to
match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at
the beginning of a line.
! @item $
is similar to @samp{^} but matches only at the end of a line. Thus,
@samp{x+$} matches a string of one @samp{x} or more at the end of a line.
! @item \
has two functions: it quotes the special characters (including
@samp{\}), and it introduces additional special constructs.
--- 536,552 ----
mentioned as one of the characters not to match. This is in contrast to
the handling of regexps in programs such as @code{grep}.
! @item @kbd{^}
is a special character that matches the empty string, but only at the
beginning of a line in the text being matched. Otherwise it fails to
match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at
the beginning of a line.
! @item @kbd{$}
is similar to @samp{^} but matches only at the end of a line. Thus,
@samp{x+$} matches a string of one @samp{x} or more at the end of a line.
! @item @kbd{\}
has two functions: it quotes the special characters (including
@samp{\}), and it introduces additional special constructs.
- [Emacs-diffs] Changes to emacs/man/search.texi,
Miles Bader <=