title: Sed and regex print only match
body: <pre><code>sed -er '.*(textsringhere.+?(?= ))(?:.*)((?&gt;\d{4})-(?&gt;\d{2})-(?&gt;\d{2}) (?&gt;\d{2}):(?&gt;\d{2}):(?&gt;\d{2})).* (ERROR.*)' errors.txt
  </code></pre>
  
  <p>Running the above command on my <code>errors.txt</code> file simply produces all the matching lines in that file.  I had assumed that adding <code>.*</code> to the beginning of my regex would have forced <code>sed</code> to replace the entire line with the matches? </p>
  
  <p><strong>Sample</strong></p>
  
  <p>Input:</p>
  
  <pre>
  Aug  2 16:36:37 App.Dev.thing1 839854b7-749-4f12-89e0-3ad002ab5ffe[[APP/PROC/WEB/0]] 2017-08-02 16:36:37 [main] ERROR o.s.boot.SpringApplication - Application startup failed
  Aug  2 18:04:46 App.Dev.thing2 eaedf253-df57-4c12-ade6-ea73274dbbc4[[APP/PROC/WEB/0]] 2017-08-02 18:04:46 [main] ERROR o.s.boot.SpringApplication - Application startup failed
  Aug  3 01:45:55 App.Dev.thing2 eaedf253-df57-4c12-ade6-ea73274dbbc4[[APP/PROC/WEB/0]] 2017-08-03 01:45:55 [http-nio-8080-exec-1] ERROR c.c.v.b.m.c.i.thing2 - Error Processing Batch, this batch will be consumed individually`
  </pre>
  
  <p>Expected output:</p>
  
  <pre>
  App.Dev.thing1 ERROR o.s.boot.SpringApplication - Application startup failed
  App.Dev.thing2 ERROR o.s.boot.SpringApplication - Application startup failed
  App.Dev.thing2 ERROR c.c.v.b.m.c.i.thing2 - Error Processing Batch, this batch will be consumed individually`
  </pre>