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

RE: Substitution problem

Expand Messages
  • Keith W. Roberts
    ... You got two great answers, but I thought I d amplify. The reason your original didn t work was that [^2] specifies that there *must* be a character
    Message 1 of 4 , Aug 31, 2005
      > -----Original Message-----
      > From: Bouckaert, Hugo [mailto:Hugo.Bouckaert@...]
      > Sent: Wednesday, August 31, 2005 1:44 AM
      > To: vim@...
      > Subject: Substitution problem
      >
      >
      > Hi
      >
      > I have a minor irritating problem with substitution I can't
      > seem to get
      > right. I want to substitute:
      >
      > :%s/lv_postal_street/r_bio.postal_street/g
      >
      > But the problem is that I also have a string
      > "lv_postal_street2" so that
      > for lv_postal_street2 it also substitutes "r_bio.postal_street".
      >
      > I tried
      >
      > :%s/lv_postal_street[^2]/r_bio.postal_street/g
      >
      > i.e. "lv_postal_street", "not followed by 2" but it does not work.
      >
      > Any ideas?

      You got two great answers, but I thought I'd amplify. The reason your
      original didn't work was that [^2] specifies that there *must* be a
      character following the rest of the string, just not a '2'.

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