Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!ll-xn!husc6!mit-eddie!UKANVAX.BITNET!HUXTABLE From: HUXTABLE@UKANVAX.BITNET ("John L. Huxtable") Newsgroups: comp.emacs Subject: RE: function needed: is (point) within regexp? Message-ID: <8807150310.AA09024@EDDIE.MIT.EDU> Date: 14 Jul 88 13:44:00 GMT Sender: daemon@eddie.MIT.EDU Lines: 26 I've been trying to get this out through INTERNET but someone keeps timing out. ----------------------------Original message---------------------------- From: KUHUB::HUXTABLE "John L. Huxtable" 13-JUL-1988 10:19 To: IN%"info-gnu-emacs@prep.ai.mit.edu",HUXTABLE Subj: RE: function needed: is (point) within regexp? > Date: Thu, 7 Jul 88 08:59:22 +0200 > From: Marc Shapiro> Subject: Function needed: is point within regexp? > > I am hacking a new, much-improved bibtex-mode for GNU Emacs. For > this, I need a function which checks if point is *within* a certain > regular expression. Yes, there is a better way. The functions (match-beginning COUNT) and (match-end COUNT) return the positions matched by the beginning and end of the last regexp searched for. The arg COUNT should be 0 to match the entire regexp, 1 to match the text matched by \1, etc. This exists in EMACS 18.50. I don't know the earliest version it came with. Yours, John L. Huxtable Computing Services The University of Kansas huxtable@kuhub.cc.ukans.edu huxtable@ukanvax.bitnet