title: How save each Capturing Groups of a bash regex?
body: <p>To make it really simple, I must use a regex to select string in a complex file.
  I would like to "save" in a file some part of the regex selection. So I use capturing groups and... I don't know how to use th result.</p>
  
  <p>For ex:
  list.txt :</p>
  
  <blockquote>
    <p>abc 123 def 456</p>
  </blockquote>
  
  <p>Here my regex with capture group :</p>
  
  <pre><code>(\d{3}) (\w{3})
  </code></pre>
  
  <p>The shell command with grep for example (can be something else, I don't care):</p>
  
  <pre><code>egrep '(\d{3}) (\w{3})' list.txt
  </code></pre>
  
  <p>How do I save or use every \d{3} and \w{3} results?
  I can't just use</p>
  
  <pre><code>egrep '\d{3}' &gt; digit.txt
  </code></pre>
  
  <p>Because the capture group is just a small part of a bigger regex</p>
  
  <p>Thanks</p>