in reply to Re: extracting search term context
in thread extracting search term context

probably a little better would be to use \b and \w instead of defining a word and separator from sratch, or even use the posix equivalents for more clarity. also a further suggestion to the original question, an alternative would be to read the file in the desired chunks/units to start with, each time through the loop reading one extra word from the file into this comparison buffer and dropping one word off at the end of the buffer. In other words a sliding window/buffer technique with word being step size.
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^3: extracting search term context
by BrowserUk (Patriarch) on Jun 09, 2010 at 06:31 UTC
    probably a little better would be to use \b and \w instead of defining a word and separator from sratch

    I invite you to demonstrate this.

    reading one extra word from the file

    How do you read a "word" from a file?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.