Reputation: 453
I have the simplest of code thats supposed to compare two string inputs as follows:
public class Validate {
public static void main(String[] args) {
String re = args[0];
String input = args[1];
System.out.println(input.matches(re));
}
}
It works as expected except if your two inputs are $
and$
, it just prints out false. I did hear about how you have to escape any special regex characters, including dollar sign.
But what if you want to compare two dollar signs and print out true
Upvotes: -2
Views: 298