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

Re: Help on search and replace

Expand Messages
  • Tobia
    ... Notwithstanding the usefulness of sub-replace-special, which I also discovered in this thread, I find zero-width look-ahead/behind ... ( [ [^]]* )@
    Message 1 of 9 , Mar 29, 2007
    • 0 Attachment
      Dudley Fox wrote:
      > Starting text:
      > nameTable[pattern with spaces0] = ("pattern with spaces0", 12345)
      >
      > Desired Text:
      > nameTable[patternwithspaces0] = ("pattern with spaces0", 12345)

      Notwithstanding the usefulness of sub-replace-special, which I also
      discovered in this thread, I find zero-width look-ahead/behind
      assertions to be very powerful:

      :%s/\v(\[[^]]*)@<=\s//g

      (
      \[
      [^]]*
      )@<=
      \s

      I also happen to like \v, but that's just syntactic sugar!


      Tobia
    Your message has been successfully submitted and would be delivered to recipients shortly.