diff options
author | Richard M. Stallman <rms@gnu.org> | 2002-03-21 09:37:22 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2002-03-21 09:37:22 +0000 |
commit | 081e9e04e40a598a8b1c4082b0ee66e239eee23d (patch) | |
tree | 004b5545a1aeb2507c6461062edc3feb2fd945f6 /man | |
parent | 70a538a3fda8401b2ac0f01d7a75864e76c75253 (diff) | |
download | emacs-081e9e04e40a598a8b1c4082b0ee66e239eee23d.tar.gz |
Clarify non-greedy repetition in searching.
Diffstat (limited to 'man')
-rw-r--r-- | man/search.texi | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/man/search.texi b/man/search.texi index 36ed3747154..1739f93bc8d 100644 --- a/man/search.texi +++ b/man/search.texi @@ -463,6 +463,13 @@ the text @samp{abbb}, @samp{ab*} will match it all (the longest valid match), while @samp{ab*?} will match just @samp{a} (the shortest valid match). +Non-greedy operators match the shortest possible string starting at a +given starting point; in a forward search, though, the earliest +possible starting point for match is always the one chosen. Thus, if +you search for @samp{a.*?$} against the text @samp{abbab} followed by +a newline, it matches the whole string. Since it @emph{can} match +starting at the first @samp{a}, it does. + @item \@{@var{n}\@} is a postfix operator that specifies repetition @var{n} times---that is, the preceding regular expression must match exactly @var{n} times |