On 10/10/2011 06:13 p.m., Tim Chase wrote:
> 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

Thanks a lot,
I tested with the first one and it works.

Best regards,

--
Cesar

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