title: Why does pos() report matches even with non-capturing groups?
body: <p>I want to match the placeholders (bare <code>?</code>, without quotes) in a parameterized SQL query like this:</p>
  
  <pre class="lang-sql prettyprint-override"><code>UPDATE `table` SET `col1`=? WHERE `col2`=? AND `x`="??as"
  </code></pre>
  
  <p>(I know I should be using <code>SQL::Parser</code> instead. Bear with me here.)</p>
  
  <p>This regex <code>(?:`.+?`)|(?:'.+?')|(?:".+?")|(\?)</code> matches the bare question marks in <code>`col1`=?</code> and <code>`col2`=?</code> but skips the question marks inside the double quotes in <code>`x`="??as"</code>, as I want it to. You can see this working at <a href="https://regex101.com/r/iH4aV2/3" rel="nofollow">https://regex101.com/r/iH4aV2/3</a>.</p>
  
  <p>Now that regex is run by PCRE. If I run this bit of Perl:</p>
  
  <pre class="lang-pl prettyprint-override"><code># same regex and test string
  my $x = 'UPDATE `table` SET `col1`=? WHERE `col2`=? AND `x`="??as"';          
  
  while ($x =~ /(?:`.+?`)|(?:'.+?')|(?:".+?")|(\?)/g) {
      print "A:".pos($x)."\n";
  }
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>A:14
  A:25
  A:27
  A:40
  A:42
  A:50
  A:57
  </code></pre>
  
  <p>I was expecting to get only the positions of the bare question marks, like on the regex101 site:</p>
  
  <pre><code>A:27
  A:42
  </code></pre>
  
  <p>Why is this happening? Can I make Perl's regex engine behave like PCRE?</p>