title: Perl regex and capturing groups
body: <p>The following prints <code>ac | a | bbb | c</code></p>
  <pre><code>    #!/usr/bin/env perl
      use strict;
      use warnings;
      # use re 'debug';
      
      my $str = 'aacbbbcac';
      
      if ($str =~ m/((a+)?(b+)?(c))*/) {
         print &quot;$1 | $2 | $3 | $4\n&quot;;
      }
  </code></pre>
  <p>It seems like failed matches do not reset the captured group variables.
  What am I missing?</p>