When using "\t", the escape sequence \t is replaced by Java with the character U+0009. When using "\\t", the escape sequence \\ in \\t is replaced by Java with \, resulting in \t that is then interpreted by the regular expression parser as the character U+0009.

So both notations will be interpreted correctly. It’s just the question when it is replaced with the corresponding character.

Leave a Reply

Your email address will not be published. Required fields are marked *