title: File path validation in javascript
body: <p>I am trying to validate XML file path in javascript. My REGEX is:</p>
  
  <pre><code>var isValid = /^([a-zA-Z]:)?(\\{2}|\/)?([a-zA-Z0-9\\s_@-^!#$%&amp;+={}\[\]]+(\\{2}|\/)?)+(\.xml+)?$/.test(str);
  </code></pre>
  
  <p>It returns true even when path is wrong.
  These are valid paths</p>
  
  <pre><code>D:/test.xml
  D:\\folder\\test.xml
  D:/folder/test.xml
  D:\\folder/test.xml
  D:\\test.xml
  </code></pre>