# HG changeset patch # User Stefan Monnier # Date 952557960 0 # Node ID f1b33463506d069aef4d8c6a7212d4154e9b04a3 # Parent 26edef632c89ad407c92d4a94b4df8ec1a0c4ed7 *** empty log message *** diff -r 26edef632c89 -r f1b33463506d etc/NEWS --- a/etc/NEWS Wed Mar 08 23:25:41 2000 +0000 +++ b/etc/NEWS Wed Mar 08 23:26:00 2000 +0000 @@ -1087,7 +1087,7 @@ +++ ** Regular expressions now support intervals \{n,m\} as well as -Perl's non-greedy *? +? and ?? operators. +Perl's shy-groups \(?:...\) and non-greedy *? +? and ?? operators. +++ ** The optional argument BUFFER of function file-local-copy has been diff -r 26edef632c89 -r f1b33463506d man/search.texi --- a/man/search.texi Wed Mar 08 23:25:41 2000 +0000 +++ b/man/search.texi Wed Mar 08 23:26:00 2000 +0000 @@ -432,16 +432,16 @@ as they can, while if you append a @samp{?} after them, it makes them non-greedy: they will match as little as possible. -@item \@{n,m\@} +@item \@{@var{n},@var{m}\@} is another postfix operator that specifies an interval of iteration: -the preceding regular expression must match between @samp{n} and -@samp{m} times. If @samp{m} is omitted, then there is no upper bound -and if @samp{,m} is omitted, then the regular expression must match -exactly @samp{n} times. @* +the preceding regular expression must match between @var{n} and +@var{m} times. If @var{m} is omitted, then there is no upper bound +and if @var{,m} is omitted, then the regular expression must match +exactly @var{n} times. @* @samp{\@{0,1\@}} is equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to @samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. @* -@samp{\@{n\@}} is equivalent to @samp{\@{n,n\@}}. +@samp{\@{@var{n}\@}} is equivalent to @samp{\@{@var{n},@var{n}\@}}. @item [ @dots{} ] is a @dfn{character set}, which begins with @samp{[} and is terminated @@ -560,7 +560,15 @@ This last application is not a consequence of the idea of a parenthetical grouping; it is a separate feature that is assigned as a second meaning to the same @samp{\( @dots{} \)} construct. In practice -there is no conflict between the two meanings. +there is almost no conflict between the two meanings. + +@item \(?: @dots{} \) +is another grouping construct (often called ``shy'') that serves the same +first two purposes, but not the third: +it cannot be referred to later on by number. This is only useful +for mechanically constructed regular expressions where grouping +constructs need to be introduced implicitly and hence risk changing the +numbering of subsequent groups. @item \@var{d} matches the same text that matched the @var{d}th occurrence of a diff -r 26edef632c89 -r f1b33463506d src/ChangeLog Binary file src/ChangeLog has changed