title: RegEx: When given an string that does not match to pattern how to define if exist larger string (containing smaller one) that does match?
body: <p>I need to write simple program that takes 2 parameters (RegEx pattern and string) and if string does not match answers whether exist larger string (containing smaller one) that can match pattern. </p>
  
  <p><strong>Example1</strong> 
  Input: "^\w+\s+\w+$" and "hello" are not match, but program will return 'true' because there is string "hello word" that contains first one and matches to given pattern</p>
  
  <p><strong>Example2</strong> 
  Input: "^(abc)*$" and "ca" not match, but program will return true because there is string ab<strong>ca</strong>bc (contains ca) that matches to pattern.</p>
  
  <p>In short, program needs to answer if such string exist (true/false).</p>
  
  <p>C# (C++, Java) and any help will be appreciated. At least some direction how to do it.</p>