From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jos=E9_A=2E_Romero_L=2E?= Newsgroups: gmane.emacs.help Subject: Re: I need help with a regular expression Date: Fri, 16 Apr 2010 15:16:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: <83ceaced-77d2-4c96-a750-e328b74a33b8@u31g2000yqb.googlegroups.com> References: <87ljcnw0n1.fsf@linux-lqcw.site> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273008031 14972 80.91.229.12 (4 May 2010 21:20:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 21:20:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 23:20:30 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9PXW-0002Ps-JA for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 23:20:26 +0200 Original-Received: from localhost ([127.0.0.1]:33440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9PXV-0006eu-T8 for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 17:20:25 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!u31g2000yqb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 89.78.68.41 Original-X-Trace: posting.google.com 1271456201 1933 127.0.0.1 (16 Apr 2010 22:16:41 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 16 Apr 2010 22:16:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u31g2000yqb.googlegroups.com; posting-host=89.78.68.41; posting-account=mkEKGAoAAACAV2vhv5r9WHXWqsdL_niD User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177731 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73179 Archived-At: On 16 Kwi, 23:25, Cecil Westerhof wrote: (...) > thinking about something like: > =A0 =A0 "^[^;]+(defun " > > But that does not work. It marks the following completely, instead of > the three at its own: > =A0 =A0 (defun a () (message "a")) > =A0 =A0 (defun b () (message "b")) > =A0 =A0 (defun c () (message "c")) > > Why is this? And how can I make a regular expression that does what I > want? Because emacs regular expressions are by default multi-line? All in all an emacs buffer is just a very long stream of characters, so this approach makes sense, I guess. Try this instead: "^[^;\n]*(defun " - and remember: regexp-builder is your friend ;-) Cheers, -- Jos=E9 A. Romero L. escherdragon at gmail "We who cut mere stones must always be envisioning cathedrals." (Quarry worker's creed)