[Solved] What’s the difference between “c&&c” and “[c&&c]” in Java’s regular expressions? [duplicate]

[ad_1]

What’s the meaning of && in the second call ?

[c&&c] is character class with means either of the characters in it.

I got true.

Because c matches either of c&&c. Basically [c&] will be enough.

c&&c means literally. c followed by & followed by & followed by c. Which does not match just c.

1

[ad_2]

solved What’s the difference between “c&&c” and “[c&&c]” in Java’s regular expressions? [duplicate]