[Linux-kernel-mentees] [PATCH RFC v2] checkpatch: extend attributes check to handle more patterns
Joe Perches
joe at perches.com
Fri Oct 23 21:04:13 UTC 2020
On Sat, 2020-10-24 at 02:27 +0530, Dwaipayan Ray wrote:
> Also I tried the pattern attr =~ s/^_*(.*)_*$/$1/
> for trimming the _ earlier. I think it doesn't trim the
> trailing underscores in the suffix as (.*) captures everything greedily.
>
> Is the iterative one perhaps okay instead?
> while($attr =~ s/(.*)_$/$1/) {}
Then perhaps
$curr_attr =~ s/^_+//; $curr_attr =~ s/_+$//;
More information about the Linux-kernel-mentees
mailing list