Sunday, August 11, 2013

Re: why does /\[^\s] not find the character 's'?

On Sunday, August 11, 2013 8:38:56 PM UTC-5, tom arnall wrote:
> greetings!
>
>
>
> when i do a search using:
>
>
>
>      /\[^\s]
>
>
> it behaves as it shd, i.e., it finds anything that's not a whitespace,

No, it doesn't. I assume you're using "nomagic" so that \[...] is a collection, not a literal '[' character and some other stuff.

Inside a collection, \s does NOT mean whitespace. It means a '\' character or an 's' character. So you're actually matching "anything not a backslash and not the letter 's'" which WILL match whitespace. See just below :help /\] for a list of the ONLY backslash codes recognized inside [...].

I think you want \S (by itself, not within [^...].

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: