aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-11-03 19:19:41 +0000
committerChong Yidong2008-11-03 19:19:41 +0000
commit1899a5d06fa7c4db51a789d301046e296a698549 (patch)
treec3ee2eb3b4224a72d7c6cbe8faf1a8fcaa26f524
parent0177762770508ca1343c181439bf5992345472e2 (diff)
downloademacs-1899a5d06fa7c4db51a789d301046e296a698549.tar.gz
emacs-1899a5d06fa7c4db51a789d301046e296a698549.zip
(Regexp Search): Document GREEDY arg.
(Simple Match Data): Fix return value.
-rw-r--r--doc/lispref/searching.texi10
1 files changed, 8 insertions, 2 deletions
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.
1094@end example 1094@end example
1095@end defun 1095@end defun
1096 1096
1097@defun looking-back regexp &optional limit 1097@defun looking-back regexp &optional limit greedy
1098This function returns @code{t} if @var{regexp} matches text before 1098This function returns @code{t} if @var{regexp} matches text before
1099point, ending at point, and @code{nil} otherwise. 1099point, ending at point, and @code{nil} otherwise.
1100 1100
@@ -1105,6 +1105,12 @@ You can bound the time required by specifying @var{limit}, which says
1105not to search before @var{limit}. In this case, the match that is 1105not to search before @var{limit}. In this case, the match that is
1106found must begin at or after @var{limit}. 1106found must begin at or after @var{limit}.
1107 1107
1108If @var{greedy} is non-@code{nil}, this function extends the match
1109backwards as far as possible, stopping when a single additional
1110previous character cannot be part of a match for regexp. When the
1111match is extended, its starting positiong is allowed to occur before
1112@var{limit}.
1113
1108@example 1114@example
1109@group 1115@group
1110---------- Buffer: foo ---------- 1116---------- Buffer: foo ----------
@@ -1408,7 +1414,7 @@ subexpression is at the 13th character (@samp{c}).
1408 (re-search-forward "The \\(cat \\)") 1414 (re-search-forward "The \\(cat \\)")
1409 (match-beginning 0) 1415 (match-beginning 0)
1410 (match-beginning 1)) 1416 (match-beginning 1))
1411 @result{} (9 9 13) 1417 @result{} (17 9 13)
1412@end group 1418@end group
1413 1419
1414@group 1420@group