title: Excluding Backslash With a QRegExp?
body: <p>I want to create a regular expression to exclude characters that aren't valid in file names.  On Windows the invalid characters are /:*?"&lt;>| so I tried:</p>
  
  <pre><code>QRegExp("^[^\\/:*?\"&lt;&gt;|]*$")
  </code></pre>
  
  <p>This works for all characters apart from the backslash.  Since double backslash wasn't working I thought I'd see what happened if I used a single backslash, but that gave the compiler warning <strong>warning: unknown escape sequence: '/'</strong> and didn't fix the problem.</p>
  
  <p>How can I modify the regular expression so that it will successfully exclude the backslash character when used with a QRegExpValidator?</p>
  
  <p>Just as an aside, the reason I'm doing this is because QDir::rename() doesn't appear to check for invalid characters, so the files can become inaccessible if invalid characters are entered.  Is limiting the characters the user can enter the best solution to avoiding this or does QDir offer a mechanism that I've missed?</p>