[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a544ceh0.fsf@trenco.lwn.net>
Date: Tue, 12 Aug 2025 17:22:35 -0600
From: Jonathan Corbet <corbet@....net>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, Akira Yokosawa
<akiyks@...il.com>
Subject: Re: [PATCH 6/7] docs: kdoc: tighten up the pointer-to-function case
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> writes:
> On Tue, 12 Aug 2025 13:57:47 -0600
> Jonathan Corbet <corbet@....net> wrote:
>
>> - r = KernRe(r'[^\(]+\(\*?\s*([\w\[\].]*)\s*\)')
>> + r = KernRe(r'[^\(]+\(\*?\s*' r'([\w\[\].]*)' r'\s*\)')
>
> Heh, it took me a couple of seconds to understand this concat, as I haven't
> seem concat pattern like that before (maybe except for some old C book
> I read a millennium ago that I barely remember). So, IMO, it became harder
> to understand this way. I would either remove the extra two ' r' from the
> string or write it as:
>
> r = KernRe(r'[^\(]+\(\*?\s*'
> r'([\w\[\].]*)'
> r'\s*\)')
By remove the " r" you mean glom the pieces back together into a single
string? These long regexes are hard to make sense of, I do think it
helps to break them into logical chunks.
Certainly I can split it across multiple lines if that helps.
Thanks,
jon
Powered by blists - more mailing lists