[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
- Re: Why are RegExps never working?, (continued)
- Message not available
- Re: Why are RegExps never working?, Giorgos Keramidas, 2007/11/13
- Re: Why are RegExps never working?, Peter Dyballa, 2007/11/13
- Re: Why are RegExps never working?, Giorgos Keramidas, 2007/11/13
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/13
- Re: Why are RegExps never working?, Peter Dyballa, 2007/11/14
- Re: Why are RegExps never working?, Sven Bretfeld, 2007/11/14
- Message not available
- Re: Why are RegExps never working?, Giorgos Keramidas, 2007/11/14
- Re: Why are RegExps never working?, Johan Bockgård, 2007/11/14
- Re: Why are RegExps never working?,
Tim X <=
- Re: Why are RegExps never working?, Johan Bockgård, 2007/11/16