This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/regcomp.pl: Allow ';' in comments
authorKarl Williamson <public@khwilliamson.com>
Fri, 6 Jul 2012 17:31:11 +0000 (11:31 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 25 Jul 2012 03:13:45 +0000 (21:13 -0600)
If a comment contained a semi-colon, the regular expression's greedy
quantifier would think the portion of the comment before it was part of
the data to be processed

regen/regcomp.pl

index 69643ca..eef5533 100644 (file)
@@ -34,7 +34,7 @@ while (<DESC>) {
         next;
     }
     unless ($lastregop) {
-        ($name[$ind], $desc, $rest[$ind]) = /^(\S+)\s+([^\t]+)\s*;\s*(.*)/;
+        ($name[$ind], $desc, $rest[$ind]) = /^(\S+)\s+([^\t]+?)\s*;\s*(.*)/;
         ($type[$ind], $code[$ind], $args[$ind], $flags[$ind], $longj[$ind])
           = split /[,\s]\s*/, $desc;
         ++$ind;