title: Java regexp error: \( is not a valid character
body: <p>I was using java regexp today and found that you are not allowed to use the following regexp sequence</p>
  
  <pre><code>String pattern = "[a-zA-Z\\s\\.-\\)\\(]*";
  </code></pre>
  
  <p>if I do use it it will fail and tell me that \( is not a valid character.</p>
  
  <p>But if I change the regexp to</p>
  
  <pre><code>String pattern = "[[a-zA-Z\\s\\.-]|[\\(\\)]]*";
  </code></pre>
  
  <p>Then it will work. Is this a bug in the regxp engine or am I not understanding how to work with the engine?</p>
  
  <p><em>EDIT:</em> I've had an error in my string: there shouldnt be 2 starting [[, it should be only one. This is now corrected</p>