Ask questionsUnrecognized escape sequence

Clippy version: clippy 0.0.212 (265318d 2019-05-17)

I get the following error when linting code, and I have a feeling it might be a bug. If it is not, it maybe clippy can give a correct suggestion?

error: regex syntax error: unrecognized escape sequence
   --> src/compiler/
187 |         static ref RE: Regex = Regex::new("^..?($|[\\/])").unwrap();
    |                                                    ^^
    = note: #[deny(clippy::invalid_regex)] on by default
    = help: for further information visit

Answer questions ThomasdenH

I found the solution here. The reason it fails is because it should be escaped once for the string literal, and once for the regex. If possible, a better description of the problem would be nice.

Github User Rank List