IntelliJ says that \ b (backspace) is an illegal escape sequence inside a string literal. What for?

I have this piece of code

private static final Pattern controlChars = Pattern.compile(
        "[\u0001-\u0008\u000B\u000C\u000E-\u001F\u007F]");

and the idea of ​​IntelliJ (2016.3) put a red line under \u0008, saying that this is an illegal / unsupported escape sequence. Changing it to any of \b, \010or \x08does not affect.

What I do not understand is that the code builds and works without problems. Think what the problem is?

+4
source share
1 answer

This is a bug in RegExp support. It is captured in IntelliJ IDEA 2017.1 Public Preview .

() , , Alt + Enter Un-inject Language/Reference. RegExp .

+3

Source: https://habr.com/ru/post/1671161/


All Articles