title: Not being able to detect '-' character in regular expression
body: <p>I am trying to test whether a character is a special character or not. </p>
  
  <p>It fails for '-' character when I write the following code:</p>
  
  <pre><code>import re
  
  s = '-'
  regex = re.compile('[!@#$%^&amp;*()-+]')
  
  if regex.search(s) == None:
      print("Not found")
  else:
      print("Found")
  </code></pre>
  
  <p><strong>Output>>Not found</strong></p>
  
  <p>However, if I change the position of the '-' character in the pattern as follows (line 3 of code), it works correctly</p>
  
  <pre><code>import re 
  
  s = '-'
  regex = re.compile('[!@#$%^&amp;*()+-]')
  
  if regex.search(s) == None:
      print("Not found")
  else:
      print("Found")
  </code></pre>
  
  <p><strong>Output>>Found</strong></p>
  
  <p>What is causing this difference and how can I make sure that the characters will be detected?</p>