I've been using the following with great success:
(["'])(?:(?=(\?))2.)*?1
It supports nested quotes as well.
For those who want a deeper explanation of how this works, here's an explanation from user ephemient:
([""'])
match a quote; ((?=(\?))2.)
if backslash exists, gobble it, and whether or not that happens, match a character; *?
match many times (non-greedily, as to not eat the closing quote); 1
match the same quote that was use for opening.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…