title: Greedy regex does not pick the closest choice
body: <p>my regex does not pick the closest <code>[A]</code> What can be a solution for this case?</p>
  
  <p>Input:</p>
  
  <pre><code>[A]xxx[A]yyyy[B]
  </code></pre>
  
  <p>Regex:</p>
  
  <pre><code>\[A\](?!\[A\])(.*?)\[B\]
  </code></pre>
  
  <p>Match:</p>
  
  <pre><code>[A]xxx[A]yyyy[B]
  </code></pre>
  
  <p>Match I need:</p>
  
  <pre><code>[A]yyyy[B]
  </code></pre>