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

92Re: removing control characters

Expand Messages
  • Benji Fisher
    Aug 4, 2000
    • 0 Attachment
      Robert Link wrote:
      >
      > -----BEGIN PGP SIGNED MESSAGE-----
      > Hash: SHA1
      >
      > I want to take an old MSWord file, open it in vimppc, and zap all
      > control characters, leaving me alpha-num-punctuation; here's what I
      > thought should work:
      >
      > :%s/[[:cntrl:]]//g
      >
      > This nets me a warning, "Pattern not found: [[:cntrl:]]"
      >
      > All help appreciated, backchannel is just fine. Thanks!!
      > - --
      > Robert Link

      I find the same problem, even after adding <C-X> and <C-C> to my
      file. Maybe you and I do not understand what is meant by control
      characters, or maybe it is a bug. I get the same behavior under linux.

      Why not try

      :s/[^[:punct:][:alnum:][:space:]]//g

      or

      :s/[^[:print:]]//g

      Maybe the first: I do not know whether control characters count as
      "printable," but <Tab> does not. BTW, <Tab> is really <C-I>; you might
      want to keep those.

      HTH --Benji Fisher
    • Show all 3 messages in this topic