How do you escape special characters in a Java regular expression?

Last Updated :
Discuss
Comments

How do you escape special characters in a Java regular expression?

By using the backslash (\)

By using double backslash (\\)

By using a Matcher object

By using parentheses ()

Share your thoughts in the comments