From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.emacs.help Subject: Re: I need help with a regular expression Date: Sat, 17 Apr 2010 08:20:40 +0200 Organization: Decebal Computing Message-ID: <87hbnawqfb.fsf@linux-lqcw.site> References: <87ljcnw0n1.fsf@linux-lqcw.site> <83ceaced-77d2-4c96-a750-e328b74a33b8@u31g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1273008516 16677 80.91.229.12 (4 May 2010 21:28:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 21:28:36 +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:28:35 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 1O9PfP-0006Wo-Jr for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 23:28:35 +0200 Original-Received: from localhost ([127.0.0.1]:46699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9PfP-000082-0q for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 17:28:35 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!newsfeed.bit.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help X-Homepage: http://www.decebal.nl/ User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:+aHqQaI22FQ7Y1cBEJ9DnXBIn/o= Original-Lines: 28 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: 1271485219 news.xs4all.nl 22918 decebal/[::ffff:84.53.123.169]:24395 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: usenet.stanford.edu gnu.emacs.help:177739 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:73186 Archived-At: José A. Romero L. writes: >> thinking about something like: >>     "^[^;]+(defun " >> >> But that does not work. It marks the following completely, instead of >> the three at its own: >>     (defun a () (message "a")) >>     (defun b () (message "b")) >>     (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 ;-) I thought I tried that, but properly not, otherwise I should not have asked this question. Thanks. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof