title: Perl pattern matching with pattern arithmetic
body: <p>I want to understand how can I do arithmetic on matched sub-patterns in perl regex.
  This is just a sample code and I want to understand how can I use <code>\1</code> (already matched sub-pattern. in this case - 7) to match <code>pattern+1</code> <code>(8)</code></p>
  
  <pre><code>my $y = 77668;
  if($y =~ /(\d)\1(\d)\2\1+1/)   #How to increment a previously
                                 #matched sub-pattern and form a pattern?
  {
      print $y;
  }
  </code></pre>
  
  <p><strong>EDIT</strong>  </p>
  
  <p>From the answers, I see that pattern arithmetic is not possible.  </p>
  
  <p>This is what I want to achieve.<br>
  I want to form a regex which will match this pattern:</p>
  
  <pre><code>N-3N-2N-1NNN+1N+2N+3    (N = 3,4,5,6
  </code></pre>