我复制了此处找到的代码 Return positions of a regex match() in Javascript?
var str = "this is a \"quoted\" string as you can 'read'";
var patt = /'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"/igm;
while (match = patt.exec(str)) {
console.log(match.index + ' ' + patt.lastIndex);
}
在 typescript Playground 中,她为什么抱怨 match var ?