[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regexp for c-or-c++-mode
From: |
Alan Mackenzie |
Subject: |
Re: Regexp for c-or-c++-mode |
Date: |
Thu, 11 Jun 2020 09:40:53 +0000 |
Hello, Micha�.
On Thu, Jun 11, 2020 at 00:42:25 +0100, Michał Nazarewicz wrote:
> On Wed, 10 Jun 2020 at 15:15, Robert Pluim <rpluim@gmail.com> wrote:
> > >>>>> On Wed, 10 Jun 2020 14:58:18 +0100, Michał Nazarewicz
> > >>>>> <mina86@mina86.com> said:
> > Michał> On Wed, 10 Jun 2020 at 12:40, Robert Pluim <rpluim@gmail.com>
> > wrote:
> > Michał> I suppose you’re right. It should be [ \t\v\f] instead to catch
> > Michał> all non-new-line white-space characters. Or [ \t\v\f\r\n] to
> > catch
> > Michał> all white-space characters.
> > >> [[:blank:]] ?
> > Michał> [[:blank:]] is defined in terms of Unicode properties so that
> > would
> > Michał> catch things which C does not consider white-space.
> > [[:space:]] then, which uses the buffer's syntax table.
> The regex under discussion needs to adhere to C syntax but is (may be)
> used outside of cc-mode and thus should not rely on syntax table being
> set up for C.
How about using simply [ \t]? The \r doesn't really add any utility,
just confusion, and there seem not to have been any problems with
c-or-c++-mode so far. Like you said, including the "bigger" whitespace
characters might lead to false positives.
> --
> Best regards
> ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
> «If at first you don’t succeed, give up skydiving»
--
Alan Mackenzie (Nuremberg, Germany).
- Regexp for c-or-c++-mode, Alan Mackenzie, 2020/06/07
- Re: Regexp for c-or-c++-mode, Michał Nazarewicz, 2020/06/07
- Re: Regexp for c-or-c++-mode, Alan Mackenzie, 2020/06/09
- Re: Regexp for c-or-c++-mode, Michał Nazarewicz, 2020/06/10
- Re: Regexp for c-or-c++-mode, Robert Pluim, 2020/06/10
- Re: Regexp for c-or-c++-mode, Michał Nazarewicz, 2020/06/10
- Re: Regexp for c-or-c++-mode, Robert Pluim, 2020/06/10
- Re: Regexp for c-or-c++-mode, Michał Nazarewicz, 2020/06/10
- Re: Regexp for c-or-c++-mode,
Alan Mackenzie <=