title: Extracting group only if previous group was matched
body: <p>I have two examples</p>
  
  <pre><code>abc 34 def12 ghi
  abc 34 33 ghi
  </code></pre>
  
  <p>and a regexp</p>
  
  <pre><code>^.*?([0-9]{2}) ?([a-z]{2,3})? ?([0-9]{2}).*$
  </code></pre>
  
  <p>(see <a href="https://regex101.com/r/U2JNaS/1" rel="nofollow noreferrer">https://regex101.com/r/U2JNaS/1</a>)</p>
  
  <p>I need to modify it in such way to extract <code>$1</code>, <code>$2</code>, <code>$3</code> but <strong>only if</strong> <code>$2</code> was present, i.e. I need it to return</p>
  
  <pre><code>34 def12
  &lt;WRONG&gt;
  </code></pre>
  
  <p>How to achieve that? </p>