use strict;
my $str = 'SELECT \'a\', "b" from table where a = \'这是"一句\\"断\\\'了的话\' And b <> \'特别""的"""结尾\\\\\\\'\\\\\' And c in (\'单引号\', "双引号") and d in ( select \'vv\' from table_b ) ORDER BY table.id DESC limit 100,10';
my $regex = qr/([\'\"])([^\\]|\\.(?#如果有转义字符,必然是成对出现))*?\1(?#匹配和前面相同的引号)/mup;
my $subst = '?';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html