I am trying to write a String validation to match any character (regular, digit and special) except =.
Here is what I have written -
String patt
First of all, you don't need a regexp. Simply call contains:
if(str.contains("=")) System.out.println("does not"); else System.out.println("matches");
The correct regexp you're looking for is just
String patternString = "[^=]*";