On 10/10/11 18:05, Cesar Romani wrote:
I tried to do:

:%s/[^\k]//g

but it just removes everything.

Character-classes ([...]) don't take escaped-character-classes (such as "\k") within them, something I occasionally find frustrating such as in your example.

Because "\K" isn't the inverse of "\k" (like "\s" and "\S"), this is a little harder than what would otherwise be obvious. Ideas that occur to me would be to try something like one of these:

  :%s/\k\@!.//g
  :%s/\(^\|\>\).\{-\}\(\<\|$\)//g

From my rough testing, both do what you describe. On a large corpus of text, I don't know if one would perform radically better than the other.

Hope this helps,

-tim







--
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

Reply via email to