changeset 99354:ecc6f5b142f2

(Regexp Search): Document GREEDY arg. (Simple Match Data): Fix return value.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 03 Nov 2008 19:19:41 +0000
parents 899c3edf276d
children d9b39e0a0e2f
files doc/lispref/searching.texi
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/lispref/searching.texi	Mon Nov 03 19:19:33 2008 +0000
+++ b/doc/lispref/searching.texi	Mon Nov 03 19:19:41 2008 +0000
@@ -1094,7 +1094,7 @@
 @end example
 @end defun
 
-@defun looking-back regexp &optional limit
+@defun looking-back regexp &optional limit greedy
 This function returns @code{t} if @var{regexp} matches text before
 point, ending at point, and @code{nil} otherwise.
 
@@ -1105,6 +1105,12 @@
 not to search before @var{limit}.  In this case, the match that is
 found must begin at or after @var{limit}.
 
+If @var{greedy} is non-@code{nil}, this function extends the match
+backwards as far as possible, stopping when a single additional
+previous character cannot be part of a match for regexp.  When the
+match is extended, its starting positiong is allowed to occur before
+@var{limit}.
+
 @example
 @group
 ---------- Buffer: foo ----------
@@ -1408,7 +1414,7 @@
   (re-search-forward "The \\(cat \\)")
   (match-beginning 0)
   (match-beginning 1))
-    @result{} (9 9 13)
+    @result{} (17 9 13)
 @end group
 
 @group