lkml.org 
[lkml]   [2020]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RFC v2] checkpatch: extend attributes check to handle more patterns
On Sat, Oct 24, 2020 at 2:34 AM Joe Perches <joe@perches.com> wrote:
>
> 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/_+$//;
>
Okay thanks!
I will send in a new version when everything looks good
and tested.

Regards,
Dwaipayan.

\
 
 \ /
  Last update: 2020-10-23 23:11    [W:0.032 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site