title: Using regex to match any character except =
body: <p>I am trying to write a String validation to match any character (regular, digit and special) except =.</p>
  
  <p>Here is what I have written - </p>
  
  <pre><code>    String patternString = "[[^=][\\w\\s\\W]]*";
      Pattern p = Pattern.compile(patternString);
      Matcher m = p.matcher(str);
  
      if(m.matches())
          System.out.println("matches");
      else
          System.out.println("does not");
  </code></pre>
  
  <p>But, it matches the input string "2009-09/09 12:23:12.5=" with the pattern.</p>
  
  <p>How can I exclude = (or any other character, for that matter) from the pattern string?</p>