title: capturing groups in sed
body: <p>I have many lines of the form</p>
  
  <pre><code>ko04062 ko:CXCR3
  ko04062 ko:CX3CR1
  ko04062 ko:CCL3
  ko04062 ko:CCL5
  ko04080 ko:GZMA
  </code></pre>
  
  <p>and would dearly like to get rid of the ko: bit of the right-hand column. I'm trying to use sed, as follows:</p>
  
  <pre><code>echo "ko05414 ko:ITGA4" | sed 's/\(^ko\d{5}\)\tko:\(.*$\)/\1\2/'
  </code></pre>
  
  <p>which simply outputs the original string I echo'd. I'm very new to command line scripting, sed, pipes etc, so please don't be too angry if/when I'm doing something extremely dumb. </p>
  
  <p>The main thing that is confusing me is that the same thing happens if I reverse the <code>\1\2</code> bit to read <code>\2\1</code> or just use one group. This, I guess, implies that I'm missing something about the mechanics of piping the output of echo into sed, or that my regexp is wrong or that I'm using sed wrong or that sed isn't printing the results of the substitution.</p>
  
  <p>Any help would be greatly appreciated!</p>