In most programming languages, the string Hello, World! can be represented as "Hello, World!". But if you want to represent "Hello, World!" you need to escape the double quotes with backslashes for "\"Hello, World!\"", and to represent that you also need to escape the backslashes resulting in "\"\\\"Hello, World!\\\"\"".
Your challenge is to, given a printable ASCII string that's been escaped multiple times (such as "\"\\\"Hello, World!\\\"\"", find how many characters it is when fully unescaped. Specifically, you should remove a single pair of enclosing " and replace \\ with \ and \" with ", until there are no more enclosing " left.
You can assume that the string will be syntactically valid - At all stages, as long as the string starts and ends with ", all other backslashes and double quotes will be properly escaped, and only " and \ will be escaped. The input string will not be " at any level of escaping. If the string starts and ends with ", the last " cannot be escaped, so e.g. "abc\" won't occur.
This is code-golf, shortest wins!
Testcases
e -> 1
"hello" -> 5
"\"\\" -> 2
a""b"c -> 6
"c\d+e -> 6
"\"\\\"Hello, World!\\\"\"" -> 13
"c\\\"d\"" -> 5
"\"\"" -> 0
"r\"\"" -> 3
"\"hello\"+" -> 8
"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"Hello\\\\\\\\\\\\\\\"\\\\\\\"\\\"\"" -> 5
"\\\\\"" -> 3
[""] -> 4
[""]or other valid JSON corrently? \$\endgroup\$", because allowing'opens the door to backticks and various other types of quotes that deviate a bit from the intent of the challenge. \$\endgroup\$"won't occur \$\endgroup\$