title: java.util.regex.PatternSyntaxException when trying to match with regex
body: <p>When I am trying to execute the below code</p>
  
  <pre><code>text.matches("[a-zA-Z0-9 !\"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\\]^_`{|}~]");
  </code></pre>
  
  <p>I am getting exception </p>
  
  <pre><code>Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character class near index 43
  [a-zA-Z0-9 !"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~]
                                             ^
      at java.util.regex.Pattern.error(Unknown Source)
      at java.util.regex.Pattern.clazz(Unknown Source)
      at java.util.regex.Pattern.sequence(Unknown Source)
      at java.util.regex.Pattern.expr(Unknown Source)
      at java.util.regex.Pattern.compile(Unknown Source)
      at java.util.regex.Pattern.&lt;init&gt;(Unknown Source)
      at java.util.regex.Pattern.compile(Unknown Source)
      at java.util.regex.Pattern.matches(Unknown Source)
      at java.lang.String.matches(Unknown Source)
      at test.G3Utils.checkIsAttribANS(G3Utils.java:47)
      at test.G3Utils.main(G3Utils.java:6)
  </code></pre>
  
  <p>Please help me to solve this</p>