title: Valid characters for Excel sheet names
body: <p>In Java, we're using the following package to programmatically create excel documents:</p>
  
  <pre><code>org.apache.poi.hssf
  </code></pre>
  
  <p>If you attempt to set a sheet's name (NOT file, but internal Excel sheet), you will get an error if:</p>
  
  <ul>
  <li>The name is over 31 characters</li>
  <li>The name contains any of the following characters: / \ * ? [ ]</li>
  </ul>
  
  <p>However, after creating a document with a sheet name of:</p>
  
  <blockquote class="spoiler">
    <p>@#$%&amp;()+~`"':;,.|</p>
  </blockquote>
  
  <p>No error is output, and everything seems fine in Java. When you open the excel file in Office 2003, it will give you an error saying that the sheet name was invalid and that it renamed it to something generic like "Sheet 1".</p>
  
  <p>I don't know much about the previously stated package that we're using, but it looks like it's not correctly filtering invalid Excel sheet names. Any idea of how I can filter out all known invalid characters? I'm hesitant to simply filter out all non-word characters.</p>