/[emacs]/emacs/lispref/searching.texi
ViewVC logotype

Diff of /emacs/lispref/searching.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44.2.4 by miles, Sat Jul 17 02:46:47 2004 UTC revision 1.44.2.5 by miles, Wed Sep 29 07:22:16 2004 UTC
# Line 975  comes back" twice. Line 975  comes back" twice.
975  @end example  @end example
976  @end defun  @end defun
977    
978    @defun looking-back regexp &optional limit
979    This function returns @code{t} if @var{regexp} matches text before
980    point, ending at point, and @code{nil} otherwise.
981    
982    Because regular expression matching works only going forward, this is
983    implemented by searching backwards from point for a match that ends at
984    point.  That can be quite slow if it has to search a long distance.
985    You can bound the time required by specifying @var{limit}, which says
986    not to search before @var{limit}.  In this case, the match that is
987    found must begin at or after @var{limit}.
988    
989    @example
990    @group
991    ---------- Buffer: foo ----------
992    I read "@point{}The cat in the hat
993    comes back" twice.
994    ---------- Buffer: foo ----------
995    
996    (looking-back "read \"" 3)
997         @result{} t
998    (looking-back "read \"" 4)
999         @result{} nil
1000    @end group
1001    @end example
1002    @end defun
1003    
1004  @node POSIX Regexps  @node POSIX Regexps
1005  @section POSIX Regular Expression Searching  @section POSIX Regular Expression Searching
1006    

Legend:
Removed from v.1.44.2.4  
changed lines
  Added in v.1.44.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26