Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1899a5d0
Commit
1899a5d0
authored
Nov 03, 2008
by
Chong Yidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Regexp Search): Document GREEDY arg.
(Simple Match Data): Fix return value.
parent
01777627
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
doc/lispref/searching.texi
doc/lispref/searching.texi
+8
-2
No files found.
doc/lispref/searching.texi
View file @
1899a5d0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment