Metacharacters like .
, \
, {
, ^
, |
, ]
can be escaped with the \
character.
But char variables can only store exactly one character. So is it possible to store these special characters in char variables in Java?
Maybe you only need to use the escape character in String variables?
Yes, it is possible.
char c = '.';
Escaping meta-characters is only when you're dealing with Strings, not chars.