in reply to Re: Regex Problem
in thread Regex Problem

We decided to take words made up of just one actual word. So can't is not a word and neither is Smith-Jones.
As for what I've tried is not much, really:
\s?word1 [\s \w{1,20}]{0,4} word2
but I guess I messed up pretty badly..

Replies are listed 'Best First'.
Re^3: Regex Problem
by JavaFan (Canon) on Oct 24, 2008 at 09:07 UTC
    So, if "can't" is not a word, then you want a match on:
    word1 one two three can't can't can't can't can't can't word2
    because there are no more than 3 words between word1 and word2?