From: Chong Yidong Date: Mon, 3 Nov 2008 19:19:41 +0000 (+0000) Subject: (Regexp Search): Document GREEDY arg. X-Git-Tag: emacs-pretest-23.0.90~1994 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1899a5d06fa7c4db51a789d301046e296a698549;p=emacs.git (Regexp Search): Document GREEDY arg. (Simple Match Data): Fix return value. --- diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index a210d22ba77..e61dbb1dbb2 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1094,7 +1094,7 @@ comes back" twice. @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 @@ You can bound the time required by specifying @var{limit}, which says 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 @@ subexpression is at the 13th character (@samp{c}). (re-search-forward "The \\(cat \\)") (match-beginning 0) (match-beginning 1)) - @result{} (9 9 13) + @result{} (17 9 13) @end group @group