title: Conditional regex - what does ? do in the given scenario
body: <p>What does this exactly do?</p>
  
  <pre><code>(?(1)yes|no)
  If capturing group 1 was matched so far, matches the pattern before the vertical bar. Otherwise, matches the pattern after the vertical bar. A group name, or a relative position (-1) in PCRE, can be used
  </code></pre>
  
  <p>I see the following example (found in regex101.com)</p>
  
  <pre><code>/(candy)?(?(1) is true| is false)/
  candy is true is false.
  </code></pre>
  
  <p>In the above case 'candy is true' is matched. </p>
  
  <pre><code>/(candy)?(?(1) is true| is false)/
  canndy is true is false.
  </code></pre>
  
  <p>I now modified <code>candy</code> to <code>canndy</code> in the input string and now ' is false' is matched.</p>
  
  <p>However if I remove the ? in the middle (i.e the one just after (candy)), it doesn't match anything in the second case. So my question is - what role is that ? exactly carrying out?</p>