<script type="text/javascript">
var s = "3453454351{2}11{345}$Goodfdf678())";
alert(s.replace(/.*?\{(\d+)\}[^\{]*/g, "$1\xff").replace(/\xff$/, "").split("\xff").join("\n"))
</script>
var s = "3453454351{2}11{345}$Goodfdf678())";
alert(s.replace(/.*?\{(\d+)\}[^\{]*/g, "$1\xff").replace(/\xff$/, "").split("\xff").join("\n"))
</script>
<script type="text/javascript">
var s = "3453454351{2}11{345}$345}Goodfdf678())";
s = s.replace(/.*?\{(\d+)\}[^\{]*/g, "$1,");
s = s.match(/\d+(?=,)/g);
alert(s);
</script>
JS只有反向预查。所以只能这么取。或者捕获
re = /[^{]*\{([^}]*)\}/g;
while(re.exec(str))alert(RegExp.$1);