Print the total length of all "quoted" characters
APL (Dyalog Unicode), 36 bytesSBCS



Full program. Prompts for input from stdin.

≢∊t⊣{t,←'(.)(.*?)\1'⎕S'\2'⊢⍵}⍣≡⍞⊣t←⍬


Try it online!

t←⍬ set up an accumulator t (for total)

⍞⊣ discard that in favour of string input from stdin (symbol: quote in console)

{…}⍣≡ apply the following anonymous lambda until stable (fix-point; previous ≡ next)

 ⊢⍵ on the argument

 …⎕S'\2' PCRE Search for the following, returning group 2 for each match:

  (.) any character (we'll call this group 1)
  (.*?) as few characters as possible (we'll call this group 2)
  \1 the group 1 character

 t,← update t by append that to t's current value

t⊣ discard that (the final list of no matches) in favour of t

≢ count the number of characters in that