Loading ...
Sorry, an error occurred while loading the content.

125704Re: Search and write

Expand Messages
  • Tim Chase
    Sep 1, 2011
      On 09/01/11 01:10, Lars Iselid wrote:
      > I want to write the digits and actually my full regex in vim
      > is: /[-0-9]\{13,17\}
      > I want numbers with 13 to 17 digits even if they have hyphens
      > between the digits.

      For this, I'd tend to do something like put each match on its own
      line and then delete all lines that don't contain that pattern.
      Something like


      Note that this does modify your current buffer, so either (1)
      operate on a scratch buffer or (2) remember to undo it before
      saving if your original source data isn't easily reproducible.

      It gets a little trickier if you have multiple matches on the
      same line AND you want to keep them on the same line (the above
      puts each match in the same line onto its own line).


      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 11 messages in this topic