title: Replacing illegal character in fileName
body: <p>In Java, I've a File-Name-String. There I want to replace all illegal Characters with '_', but not <code>a-z</code>, <code>0-9</code>, <code>-</code>,<code>.</code> and <code>_</code></p>
  
  <p>I tried following code: But this did not worked!</p>
  
  <pre><code>myString = myString.replaceAll("[\\W][^\\.][^-][^_]", "_");
  </code></pre>