I do have following string:
\\\"lengthSeconds\\\":\\\"2664\\\"
which I would like to match with this regexp:
Regex::new(\"lengt
You only need to escape the \ in the regex and can then use a raw string.
\
r#"\\"lengthSeconds\\":\\"2664\\""# is a valid regex which matches \"lengthSeconds\":\"2664\"
r#"\\"lengthSeconds\\":\\"2664\\""#
\"lengthSeconds\":\"2664\"
Playground