title: regex: Matching parts of a string when the string contains part of a regex pattern
body: <p>I want to reduce the number of patterns I have to write by using a regex that picks up any or all of the pattern when it appears in a string.</p>
  
  <p>Is this possible with Regex?</p>
  
  <pre><code>E.g. Pattern is: "the cat sat on the mat"
  
  I would like pattern to match on following strings:
  "the"
  "the cat"
  "the cat sat"
  ...
  "the cat sat on the mat"
  </code></pre>
  
  <p>But it should not match on the following string because although some words match, they are split by a non matching word: 
      "the dog sat"</p>