Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!itivax!umich!zip!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: comp.emacs Subject: Re: Lisp Programming: Substring Searches, etc. Message-ID: <SPENCER.89Jul9162408@spline.eecs.umich.edu> Date: 9 Jul 89 20:24:08 GMT References: <397@lxn.eds.com> <65891@yale-celray.yale.UUCP> Sender: news@zippy.eecs.umich.edu Organization: University of Michigan EECS Dept Lines: 12 In-reply-to: Duchier-Denys@cs.yale.edu's message of 9 Jul 89 18:07:16 GMT In article <65891@yale-celray.yale.UUCP> Duchier-Denys@cs.yale.edu (Denys Duchier) writes: (defun extract-file-extension (filename) (and (string-match ".+\\.\\(.*\\)$" filename) (substring filename (match-beginning 1) (match-end 1)))) Actually, probably better would be (string-match ".+\\.\\([^.]*\\)$" filename) This pattern will match the last ".", while the given pattern will match the first one. -- =Spencer (spencer@eecs.umich.edu)