title: RegEx : Check if a string has any substring between quotes containing at least 3 words (separated by spaces)
body: <p>I am trying to construct a regex to by used in a python program with the following constraints</p>
  <p>Check is there is any substring within quotes with at least 3 words (separated by spaces).
  Below are some examples</p>
  <pre><code>&quot;Hello word \&quot;Foo bat baz kay \&quot; exit&quot;
  </code></pre>
  <p>This should return true since it contains the substring &quot;Foo bar baz kay&quot; with at least 3 words within the quote substring.</p>
  <pre><code>&quot; Hello hello \&quot; world \&quot; exit&quot;
  </code></pre>
  <p>should return false.</p>
  <p>Based on some investigation I was able to divide the problem into two separate parts</p>
  <ol>
  <li><p>Find a regex to get all substrings within quotes, so something like</p>
  <p>re.findall(r'&quot;(.*?)&quot;', s)</p>
  </li>
  <li><p>Find a regex to get all string with more than one word</p>
  <p>^\s*[A-Za-z0-9]+(?:\s+[A-Za-z0-9]+)<em>\s</em>$</p>
  </li>
  </ol>
  <p>I tried to put them together, but it doesn't yeild the expected result.
  Sorry I am new to regex so I am probably not doing this right. Here is the partial code.
  These ideas are compiled from the following posts
  <a href="https://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks">RegEx: Grabbing values between quotation marks</a></p>
  <p><a href="https://stackoverflow.com/questions/25131949/regex-for-one-or-more-words-separated-by-spaces">Regex for one or more words separated by spaces</a></p>
  <pre><code>s = &quot;Some string with quotes : \&quot;Hello world example\&quot; and another quote is \&quot; hello world\&quot; done&quot;
  print(re.findall(r'&quot;(^\s*[A-Za-z0-9]+(?:\s+[A-Za-z0-9]+)*\s*$)&quot;', s))
  </code></pre>
  <p>Please advise. Appreciate your help!</p>