Saturday, November 5, 2011

Re: Compound search

On Nov 4, 9:38 pm, meino.cra...@gmx.de wrote:
> Hi,
>
> suppose I want to find "holidays" after "work".
>
> The text, which I want to search has 50000 lines.
> The first word is "work" and the last one is "holidays".
>
> I do a
>
>     :/work/;/holidays/
>
> The resulting match is the whole text somehow.
>
> But may be I only want to find "holidays" which not
> such a huge gap after "work"...
>
> Is it possible to search for "holidays" right after work
> in less than a defineable distance or no "holidays" at all?
> Or is this to hard work? ;)
>
> Have a nice weekend!
> Best regards,
> mcc

This will search for 'work' and within 88 characters (including
returns) 'holidays'

/work\_.\{1,88}\holidays

season to taste

-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

No comments: