title: Trouble Using the preg_replace Option
body: <p>I have a regex:</p>
  
  <pre><code>preg_match_all('#^(((?:-?&gt;?(?:[A-Z]{3})?\d{3})+)-([0-9]{2})([0-9]{2})([0-9]{2})-\n\/O.([A-Z]{3}).KCLE.([A-Z]{2}).([A-Z]).([0-9]{4}).[0-9]{6}T[0-9]{4}Z-([0-9]{2})([0-9]{4}T[0-9]{4}Z[\/]))#', '', $matches)
  </code></pre>
  
  <p>that runs against a string(s) on a webpage. An example of a possible string:</p>
  
  <pre><code>OHZ012&gt;018-PAZ015-060815-
  /O.EXP.KCLE.BH.S.0015.000000T0000Z-170806T0700Z/
  </code></pre>
  
  <p>This will correctly match the string. However, for <code>$matches[2]</code> it will output</p>
  
  <p>OHZ012>018-PAZ015</p>
  
  <p>I want this line to read: 012>018-015 (i.e. remove the letters from that group).</p>
  
  <p>I have tried the following using preg_replace:</p>
  
  <pre><code>$matches = preg_replace('/([A-Z]{3})/','',$matches);
  </code></pre>
  
  <p>Now if I print out <code>$matches[2]</code> it just gives me the 3rd character as opposed to the group. So for example, it will print out "2" instead of "012>018-015". Any idea why it isn't printing out the entire group as I would expect?</p>