# HG changeset patch # User Richard M. Stallman <rms@gnu.org> # Date 946877162 0 # Node ID 7cc86d68ccf81fbb7545fe78f3de11b79c5132d3 # Parent 6500fd0a7d8e6d77913669bddfd329e99637ffc0 *** empty log message *** diff -r 6500fd0a7d8e -r 7cc86d68ccf8 lispref/searching.texi --- a/lispref/searching.texi Mon Jan 03 00:29:21 2000 +0000 +++ b/lispref/searching.texi Mon Jan 03 05:26:02 2000 +0000 @@ -264,6 +264,19 @@ preceding expression either once or not at all. For example, @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. +@item @samp{*?}, @samp{+?}, @samp{??} +These are ``non-greedy'' variants of the operators @samp{*}, @samp{+} +and @samp{?}. Where those operators match the largest possible +substring (consistent with matching the entire containing expression), +the non-greedy variants match the smallest possible substring +(consistent with matching the entire containing expression). + +For example, the regular expression @samp{c[ad]*a} when applied to the +string @samp{cdaaada} matches the whole string; but the regular +expression @samp{c[ad]*?a}, applied to that same string, matches just +@samp{cda}. (The smallest possible match here for @samp{[ad]*?} that +permits the whole expression to match is @samp{d}.) + @item @samp{[ @dots{} ]} @cindex character alternative (in regexp) @cindex @samp{[} in regexp