title: Validate a file name on Windows
body: <pre><code>public static boolean isValidName(String text)
  {
      Pattern pattern = Pattern.compile("^[^/./\\:*?\"&lt;&gt;|]+$");
      Matcher matcher = pattern.matcher(text);
      boolean isMatch = matcher.matches();
      return isMatch;
  }
  </code></pre>
  
  <p>Does this method guarantee a valid filename on Windows?</p>