I want to craft a regex pattern to match any word combination composed of n words
E.g.
I tried to use "(?:\w+\s){2}" to match two-word combinations in the sentence "one two three four "
I only got two matches: "one two " and "three four ".
I expect to also get another match "two three ".
Why the pattern missed it? Is there a way to fix it? JavaScript or .net flavor is preferred.
After some googling, still not find a solution. Many thanks.