On Aug 4, 5:28 pm, Tim Chase <[email protected]> wrote: > On 08/04/10 18:36, Bee wrote: > > > [^\s]\+ matches everything except "\" and "s" > > Might make sense if "\s" was not special (?magic) > > I would think it should match all non-whitespace > > > I have not found any reference that "\s" cannot be used within [...] > > similar to "\t" > > > Is this a bug? or feature? > > I'm not sure it's either a bug or a feature, but it is > documented. In my help, if I issue > > :he /\] > > and read the 2nd bullet-point (there's no nice help-tag to drop > you right to it) you'll find: > > """ > - The following translations are accepted [in a square-bracket > character-class] when the 'l' flag is not included in 'cpoptions' > {not in Vi}: > ... > \t <tab> > """ > > You'll see the other allowed items there. Note that they are all > *characters*, not *character-classes*. You may also want to make > note of the difference described at ":help cpo-l". The "\s" is a > character-class; and to get the inverse, use "\S" (capital-S). > It does make it a bit of a pain if you want to find something > like "stuff that is neither whitespace nor punctuation", but then > you can use the POSIX-style character-classes: > > /[^[:space:][:punct:]]\+ > > (There's a subtle difference between "[:blank:]" and "[:space:]" > depending on whether you want whitespace characters other than > tab/space...read up at ":help [:blank:]" and around that section)
Too subtile for me! I have looked and searched, this is the only difference I can find. *[:blank:]* [:blank:] space and tab characters *[:space:]* [:space:] whitespace characters What are other whitespace characters are than space and tab? On the Mac non-breaking space is xA0 and neither find it. Search for /\%xA0 finds the Mac non-breaking space. -Bill -- 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
