title: Regex to match the value optionally enclosed by double quotes
body: <p>I have 3 columns delimited by white spaces but the second field is optionally enclosed by double quotes.   </p>
  
  <p>I want to extract the 1st field, 2nd field(value within the double quotes) and third field, sometimes the 2nd field value might not be enclosed within the double quotes in that case just return the existing value.</p>
  
  <p><strong>Sample Input</strong>  </p>
  
  <pre><code>1a "2a 2.1a 2.2a" 3a
  4b "5.5b 5.6b 5.7b" 6b
  7c 8c 9c
  </code></pre>
  
  <p><strong>Final output</strong></p>
  
  <p>Matching Information are<br>
  <strong>1st row match</strong>  </p>
  
  <pre><code>\1 1a
  \2 2a 2.1a 2.2a
  \3 3a
  </code></pre>
  
  <p><strong>2nd row match</strong></p>
  
  <pre><code>\1 4b
  \2 5.5b 5.6b 5.7b
  \3 6b
  </code></pre>
  
  <p><strong>3rd row match</strong></p>
  
  <pre><code>\1 7c
  \2 8c
  \3 9c
  </code></pre>
  
  <p>I tried the  below regex and it works fine for the first two inputs but the third line is not matched, Can someone help me to solve this issue?</p>
  
  <p><strong>Regex i tried:</strong></p>
  
  <pre><code>([a-z0-9]+)\s+"([a-z0-9\s.]+)"\s+([a-z0-9]+)
  </code></pre>
  
  <p><strong>Link:</strong></p>
  
  <p><a href="https://regex101.com/r/rN4uB4/1" rel="nofollow">https://regex101.com/r/rN4uB4/1</a></p>