Thanks Andrew! Actually, the "timesheet" is part of an email address,
but I tried it without the angle brackets and it worked great for the
first occurrence. Unfortunately, when I did "n" for next, it seemed
to find the next occurrence of "timesheet", then keep highlighting
through many pages.
I guess that means, the search needs to only find "timesheet" through
"Winsock" that are between sections beginning and ending with
"------".
Know of a way to add that into the search?
Thanks again for your help!
HappyDad
On Oct 23, 4:11 pm, Andrew Long <[EMAIL PROTECTED]> wrote:
> On 23 Oct 2008, at 21:28, HappyDad wrote:
>
>
>
>
>
> > Hello everyone,
> > I would like to search and highlight a section of text in a mail log
> > file. I'm looking for sections that begin with
>
> > ...timesheet...
> > ...(a few lines of text)...
> > ...Winsock...
>
> > i.e. search through the text file until you hit the text "timesheet",
> > then highlight until you hit the word Winsock.
> > I'm thinking something like:
>
> > /timesheet.*Winsock
>
> > except it needs to be able to span multiple lines between the two.
> > There is text before and after both the "timesheet" and the "Winsock"
> > as well as a varying number of lines between them.
> > Is there a way to do this?
>
> Assumng that the words 'timesheet' and 'winsock' are in fact words (i.e.
> surronde by delimiters such as space, comma etc) try something like
> this:-
>
> /\<timesheet\>\_.\{-}\<Winsock\>/
>
> The angle brackets cause the search to only consider discrete words.
> '\_.' matches anything, including end-of-lines, and '\{-\}' matchces as
> few occurences as possible.
>
> HTH
>
> Regards, Andy
> --
> Andrew Long
> andrew dot long at mac dot com
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---