title: Regular expressions for Windows based file path and UNC path
body: <p>I need to validate the file path/folder structure for reg expressions in PowerShell. Please find below the examples.</p>
  
  <pre><code>c:\\scan\document\(*)  
  c:\\scan\document\word.doc  
  \\share\network\(*)  
  \\share\network\note.txt
  </code></pre>
  
  <p>Note: Need to validate for the folder path and file with any extensions as well. Please help.</p>
  
  <pre><code>^(?:[a-zA-Z]\:|\\\\[\w\.]+\\[\w.$]+)\\(?:[\w]+\\)*\w([\w.])+$
  </code></pre>