help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why are RegExps never working?


From: Tim X
Subject: Re: Why are RegExps never working?
Date: Fri, 16 Nov 2007 16:15:40 +1100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

> Giorgos Keramidas <keramida@ceid.upatras.gr> 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? 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. I
remember it because at the time I remember thinking "thats a neat little
trick to simplify the regexp"

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]