Doing this is tricky, the robustness of a regexp approach depends on what
you can assume about the input. For example, in a programming language
escaping a quote \" would be valid but unsupported, or in English
apostrophes could be taken as single quotes.

A regexp solution that is broken in those scenarios but works for the easy
cases is:

    ("|')((?:(?!\1).)*)\1

The regexp says: if you match either " o ', then countinue matching as long
as you do not find the matched quote, and until you find the closing quote
(needed because you could reach end of file with an unbalanced quote).

The second group has the string without quotes.

Whether this is going to work well for you input is something you have to
evaluate.