From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Why are RegExps never working? Date: Fri, 16 Nov 2007 11:17:23 +0100 Organization: Chalmers University of Technology, Sweden Message-ID: References: <87lk94oozv.fsf@kamaloka.dhatu> <87abpkolme.fsf@kamaloka.dhatu> <873avbyq9l.fsf@kobe.laptop> <87oddu4vpf.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1195209652 3551 80.91.229.12 (16 Nov 2007 10:40:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2007 10:40:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 16 11:40:57 2007 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.50) id 1Isycy-0006fu-9i for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Nov 2007 11:40:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Isycl-000164-44 for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Nov 2007 05:40:35 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!feed.xsnews.nl!border-2.ams.xsnews.nl!68.142.88.77.MISMATCH!hwmnpeer03.ams!news.highwinds-media.com!tudelft.nl!binfeed2.tudelft.nl!newsfeed.sunet.se!news01.sunet.se!129.16.222.141.MISMATCH!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: remote4.student.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1195208243 20866 129.16.29.77 (16 Nov 2007 10:17:23 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Fri, 16 Nov 2007 10:17:23 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:Zy6AYbF4382Z7zUgvgImVAQnJtk= Original-Xref: shelby.stanford.edu gnu.emacs.help:153854 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:49282 Archived-At: Tim X writes: > bojohan+news@dd.chalmers.se (Johan Bockgård) writes: > >> Giorgos Keramidas writes: >> >>> There's a minor 'catch' here, which may prove interesting. The >>> `character-classes' supported by the regexp engine of Emacs >>> consider the end of a line a [[:space:]] character >> >> There are several modes where this is not true, including Lisp and C. In >> these modes newlines have `endcomment' syntax. > > isn't this controlled by the syntax table? Yes. > As you can modify the syntax table, you can modify how such things > work. I seem to remember seeing a bit of elisp that did this to make > the regexp easier to write when needing to do re-search. from memory, > I think it temporarily changed the newline syntax entry in the local > syntax table, performed the search and since this was all done within > a saved context, everything is restored afterwards. (with-syntax-table (copy-syntax-table ...) (modify-syntax-entry ...)) -- Johan Bockgård