>
> This works:
>
> [^ ]\+
>
> But this doesn't:
>
> [^ ]\{-1,}
>
> Ie. one or more non-spaces, non-greedy.
If used by itself (with nothing around it), this second regexp should
match exactly one non-space. Non-greedy regexp constructs only make
sense within a larger pattern. So for instance, /a[^ ]\{-1,}a/ (or
/a\S\{-1,}a/ if you haven't got hard tabs to confuse the issue) will
match everything between and including the first two small a's which
have only nonspaces between them. The difference with the other regexp
is that in
alalalala
the former (with an a on each side, or even without) will match the
whole word while the latter will match just "ala".
>
> What am I doing incorrectly? :)
Nothing, unless you want to match something else than the fewest
possible nonspaces starting at the leftmost location where the rest of
your regexp is satisfied.
>
> vim 7.2.18
Also, Vim 7.2.018 is starting to show its age: that patchlevel was
published almost a year ago; the "current" patchlevel is 7.2.245. See
http://ftp.vim.org/pub/vim/patches/7.2/README for a one-line summary of
every 7.2 patch so far.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
109. You actually read -- and enjoy -- lists like this.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment