From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kgold@watson.ibm.com (kgold) Newsgroups: gmane.emacs.help Subject: Re: Newbie regexp question Date: 31 Oct 2002 14:45:36 GMT Organization: IBM T.J. Watson Research Center Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <3DBFF5F8.B78A64CA@enea.se> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1036075962 29527 80.91.224.249 (31 Oct 2002 14:52:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 31 Oct 2002 14:52:42 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 187Gga-0007g7-00 for ; Thu, 31 Oct 2002 15:52:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 187Gga-0003OB-00; Thu, 31 Oct 2002 09:52:40 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!news.chips.ibm.com!newsfeed.btv.ibm.com!news.btv.ibm.com!kgold Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: alpha.watson.ibm.com Original-X-Trace: news.btv.ibm.com 1036075536 10190 9.2.16.245 (31 Oct 2002 14:45:36 GMT) Original-X-Complaints-To: news@btv.ibm.com Original-NNTP-Posting-Date: 31 Oct 2002 14:45:36 GMT X-Newsreader: xrn 9.01 Originator: kgold@watson.ibm.com Original-Xref: shelby.stanford.edu gnu.emacs.help:106620 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3171 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3171 Assuming a newbie doesn't want to start writing elisp ... I do all sorts of repetitive editing like this using a keyboard macro. Since they use commands you already know (search, cursor movement, mark, kill), they're easy to create. And since they execute as they're being defined, there's less chance for error and debugging than elisp. In this case, the macro would be: isearch-forward-regexp beginning-of-line set-mark-command isearch-forward-regexp beginning-of-line next-line kill-region Paul Cohen writes: > > I want to do a Emacs regexp search and replace on a HTML file containing > patterns like this: > > > ... > > > Where "..." denotes a variable number of lines of HTML text. > > I want to search for all occurrences of the above pattern and then > remove them from the HTML file! > > I've tried a number of variants without any success. For example the > following regexp doesn't work: > > \(.*\n\)* -- -- Ken Goldman kgold@watson.ibm.com 914-784-7646