Messages in this thread | | | Subject | Re: [patch] checkpatch: complain about GW-BASIC style label names | From | Joe Perches <> | Date | Thu, 07 May 2015 13:35:16 -0700 |
| |
On Thu, 2015-05-07 at 13:17 -0700, Joe Perches wrote: > # check for label names likely used in a numeric sequence of labels > if ($line =~ /^.\s*((?:err|error|fail|out)[0-9+])\s*:/i || > $line =~ /\bgoto\s+((?:err|error|fail|out)[0-9+])\s*[:;,]/) {
Meh. I told you about my perl-fu...
That + should be outside the close bracket and it's probably better that this use a funny (?i) use inside the capture group so that the goto is lower case only, but the label can be lower, upper and mixed case.
if ($line =~ /^.\s*((?i)(?:err|error|fail|out)[0-9]+)\s*:/ || $line =~ /\bgoto\s+((?i)(?:err|error|fail|out)[0-9]+)\s*[:;,]/) {
| |