title: Find file paths that have spaces
body: <p>I am trying to create a regular expression to select file paths that contain spaces and are not wrapped in quotes.  In addition, I only want paths that begin with a volume letter (e.g., C:\, D:\, E:) and I want to ignore any switches or commands that come after the path.</p>
  
  <p>Take for instance the following list, I have highlighted in bold all of the text I want to match and return:</p>
  
  <p><hr>
  <strong>C:\This path has spaces\system.sys</strong> -switch /command<br><br>
  C:\Thispathhasnospaces\filename.exe<br><br>
  \sytem32\ThisDidNotBeginWithADriveLetter\something.doc<br><br>
  <strong>D:\This path also has spaces\something.xlsx</strong><br><br>
  "C:\I don't care if it is wrapped in quotes\something.abc" -switch<br><br></p>
  
  <hr>
  
  <p>So far what I have come up with is:</p>
  
  <p><code>^\w:\(.+)(.\w\w\w)</code></p>
  
  <p>Which sort of works, but it selects paths both with spaces and without spaces.  It also doesn't select the full filename if the path as a four character extension, such as .xlsx</p>
  
  <p>Any help would be very much appreciated.  If you do post a better regex, if you added some explanation it would really help because I am trying to learn it.</p>
  
  <p>Thanks!</p>