title: Is there a nice way to copy columns of text from a file using regex into my pasteboard?
body: <p>Currently, the solution that I have is kind of ugly and is pretty spaghetti-code like... is there a nice way to do this with a "standard" tool like <code>ack</code>?</p>
  
  <p>What I have right now is a file that is in this format:</p>
  
  <p><strong>crap.txt:</strong></p>
  
  <pre><code>IdentifierA Some Text
  IdentifierB Some Other
  </code></pre>
  
  <p>This is how I currently get it:</p>
  
  <pre><code>cat crap.txt |
  ack (?&lt;=IdentifierA ).+ |
  awk '{ print $(NF-1), $NF }' |
  pbcopy
  </code></pre>
  
  <p>This will yield <code>Some Text</code> in your pasteboard.</p>
  
  <p>Instead of just having <code>ack</code> echo out the line that matches the regex and then getting the last two columns of that line with <code>awk</code>, can I just get the specific regex match to print out to console? I tried using <code>grep -o</code> but that doesn't seem to have positive lookbehind...</p>