title: Identify the group of a Regex Match in QT
body: <p>I have a fairly large regular expression in QT that matches multiple patterns... to simplify the problem I have this regex:</p>
  
  <p><code>QRegularExpression regex = ("(?P&lt;ZipCode&gt;\d{5})|(?P&lt;emailAddress&gt;\w+@\w+\.\w+)|(?P&lt;PhoneNumber&gt;\d{3}\-\d{5,8})");</code></p>
  
  <p>To match a 5-digit zip code, an email address or to match a phone number in this format: 888-8888888 (I do not have tested the regex, but it's for demonstrational purposes, I don't care if it's wrong or not).</p>
  
  <p>Now I need to extract from the string <strong>in order</strong> those information so I use this code: </p>
  
  <p><code>QRegularExpressionMatchIterator regexIterator = regex.globalMatch("067-839405 Junk my.email@email.com Other Junk 87494 my.email2@email.co.uk");</code></p>
  
  <p>and a simple while loop.</p>
  
  <p>As you have noticed I named the groups in my regex. In the while loop how can I identify if the match I'm currently looking at is a ZipCode, an email address or a phone number?</p>
  
  <p>Thanks in Advance</p>