title: Python regex: Including whitespace inside character range
body: <p>I have a regular expression that matches alphabets, numbers, _ and - (with a minimum and maximum length).</p>
  
  <pre><code>^[a-zA-Z0-9_-]{3,100}$
  </code></pre>
  
  <p>I want to include whitespace in that set of characters.</p>
  
  <p>According to the Python documentation:</p>
  
  <blockquote>
    <p>Character classes such as \w or \S are also accepted inside a set.</p>
  </blockquote>
  
  <p>So I tried:</p>
  
  <pre><code>^[a-zA-Z0-9_-\s]{3,100}$
  </code></pre>
  
  <p>But it gives bad character range error. How can I include whitespace in the above set?</p>