Em Thu, 13 Feb 2025 13:06:17 +0100
Mauro Carvalho Chehab <mchehab+hua...@kernel.org> escreveu:

> +    def dump_function(self, ln, prototype):
> +
...

> +            (r"""
> +              __attribute__\s*\(\(
> +                (?:
> +                    [\w\s]++          # attribute name
> +                    (?:\([^)]*+\))?   # attribute arguments
> +                    \s*+,?            # optional comma at the end
> +                )+
> +              \)\)\s+
> +             """, "", re.X),

Heh, funny enough, this regex doesn't work here (Python 3.13.2), even 
after removing the extra "+" on some lines, e. g.:

            (r"""
              __attribute__\s*\(\(
                (?:
                    [\w\s]+          # attribute name
                    (?:\([^)]*\))?   # attribute arguments
                    \s*,?            # optional comma at the end
                )+
              \)\)\s+
             """, "", re.X),

I had to fold it into a non-verbose/extended regex, e. g.:

            (r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+", "", 
0),


Thanks,
Mauro

Reply via email to