title: grep output all capture groups, evening without a match
body: <p>I am writing a bash script and I'm using grep with a regular expression for some DNS records, and I have 4 capture groups, <strong>the second one is optional</strong>.</p>
  
  <p>Is it possible to get these output so that there will <strong>always</strong> be five groups, and they are in the same order each time.</p>
  
  <p>Regex I'm using in for <code>grep -Eo</code></p>
  
  <pre><code>^([a-z0-9@\-\.\*]+?)\s+(?:([0-9]*)\s)?([A-Z]*)\s*(.*)$
  </code></pre>
  
  <p>Content to match:</p>
  
  <pre><code>www    43200 A 1.2.3.4
  t        CNAME s.test.com.
  blog             A 4.3.2.1
  @                   MX 20 cluster3a.eu.messagelabs.com.
  @                   TXT ( "some text" )
  </code></pre>
  
  <p>When fed in to something like <code>awk</code>, I'd like the output for each line to be as follows</p>
  
  <pre><code>$1 = www , $2 = 43200 , $3 = A , $4 = 1.2.3.4
  $1 = t , $2 = , $3 = CNAME , $4 = s.test.com.
  $1 = @ , $2 = , $3 = MX , $4 = MX 20 cluster3a.eu.messagelabs.com.
  $1 = @ , $2 = , $3 = TXT , $4 = ( "some text" )
  </code></pre>
  
  <p>Just for clarity, i would like <strong>all</strong> groups to be output <strong>in order</strong>.</p>
  
  <p>Tearing my hair out on this one. All help appreciated.</p>