-2

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

VLAZ
  • 26,331
  • 9
  • 49
  • 67
stratofortress
  • 453
  • 1
  • 9
  • 21

1 Answers1

-1

In bash $$ is substituted by the ProcessID a small integer.

Arif Burhan
  • 507
  • 4
  • 12