Welcome to JavaRanch!
The API for java.util.regex.Pattern explains...
Backslashes within string literals in Java source code are interpreted as required by the Java Language Specification as either Unicode escapes or other character escapes. It is therefore necessary to double backslashes in string literals that represent regular expressions to protect them from interpretation by the Java bytecode compiler.
So a regex of "\\*" (with two backslashes) will match an asterisk.