title: how to copy a search selection in VI to the clipboard and paste into same file?
body: <p>I will give you an example of what I'm trying to do.  Say I have a file with the following data:</p>
  
  <pre><code>mv AB12350_PCOUTData.txt ./
  mv AB12351_PCOUTData.txt ./
  mv AB12352_PCOUTData.txt ./
  mv AB12353_PCOUTData.txt ./
  mv AB12360_PCOUTData.txt ./
  mv AB12374_PCOUTData.txt ./
  </code></pre>
  
  <p>I'm trying to copy just the "AB123xx" portion and paste to the end to get the following:</p>
  
  <pre><code>mv AB12350_PCOUTData.txt ./AB12350
  </code></pre>
  
  <p>After which I will append with a ".txt" to shorten the file name.  My thinking was that I could use the search feature with regex characters to highlight the desired piece of text like so:</p>
  
  <pre><code>/AB123[567][01234]  
  </code></pre>
  
  <p>Then I could simply copy this to the clipboard and paste it at the end of each line and append with ".txt".  Apparently Shift+Ctrl+C doesn't work for searched text, only highlighted text.  I also tried using yank and put with no success.  Is there an easy way to do this?  Or perhaps a better approach to accomplishing the same thing? My actual text files are much longer than the example above so doing it by hand is not really an option.  Thanks! </p>