title: Ruby regex extracting words
body: <p>I'm currently struggling to come up with a regex that can split up a string into words where words are defined as a sequence of characters surrounded by whitespace, or enclosed between double quotes. I'm using <code>String#scan</code></p>
  
  <p>For instance, the string:</p>
  
  <pre><code>'   hello "my name" is    "Tom"'
  </code></pre>
  
  <p>should match the words:</p>
  
  <pre><code>hello
  my name
  is
  Tom
  </code></pre>
  
  <p>I managed to match the words enclosed in double quotes by using:</p>
  
  <pre><code>/"([^\"]*)"/
  </code></pre>
  
  <p>but I can't figure out how to incorporate the surrounded by whitespace characters to get 'hello', 'is', and 'Tom' while at the same time not screw up 'my name'.</p>
  
  <p>Any help with this would be appreciated!</p>