title: match parentheses in powershell using regex
body: <p>I'm trying to check for invalid filenames.  I want a filename to only contain lowercase, uppercase, numbers, spaces, periods, underscores, dashes and parentheses.  I've tried this regex:</p>
  
  <pre><code>$regex = [regex]"^([a-zA-Z0-9\s\._-\)\(]+)$"
  $text = "hel()lo"
  
  if($text -notmatch $regex)
  {
      write-host 'not valid'
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Error: "parsing "^([a-zA-Z0-9\s\._-\)\(]+)$" - [x-y] range in reverse order"
  </code></pre>
  
  <p>What am I doing wrong?</p>