On 14/04/10 23:27, AK wrote:
I'm running into a little problem here: if I search for /\i\+\|$ it
works correctly if there's punctuation at the end of line, but if
there's a word and then EOL, the search goes to the next line. I tried
reversing them, using \n and \r, nothing helps..  -ak


For me this matches the last character on the line if it is not an 'isident' character, or the first one of one or more consecutive 'isident' characters anywhere on the line. If there is a word followed immediately by EOL, it matches the start of that word. Isn't that what you wanted?

IIUC, this won't match the last character of a line if it is part of a 2-or-more-letter word because in that case it is already part of a match starting earlier in the line. Overlapping matches are not allowed. If you want to match also the last character of a line separately even if it is part of a longer word, you must forbid the "word match" to include the last character on a line, for instance like this:

        /\i\+\ze.\|$

which will match either one or more 'isident' characters *followed by anything on the same line*, or the end of the line. In that case if the line ends with, let's say, "word" (without the quotes) and no space or punctuation after that, you will match wor as one match (cursor landing on w), and then the end-of-line as another match (cursor landing on d).


Best regards,
Tony.
--
I'm changing my name to Chrysler
I'm going down to Washington, D.C.
I'll tell some power broker
        What they did for Iacocca
Will be perfectly acceptable to me!
I'm changing my name to Chrysler,
I'm heading for that great receiving line.
When they hand a million grand out,
        I'll be standing with my hand out,
Yessir, I'll get mine!
                -- Tom Paxton

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to