regex $1 Symbol read once bug [已关闭]

h7wcgrx3  于 7个月前  发布在  其他
关注(0)|答案(1)|浏览(63)

**已关闭。**此问题为not reproducible or was caused by typos。目前不接受回答。

这个问题是由错字或无法再重现的问题引起的。虽然类似的问题在这里可能是on-topic,但这个问题的解决方式不太可能帮助未来的读者。
三个月前就关门了。
Improve this question

regex $1 Symbol read once bug

为什么我只能读一次RegExp.$1


的数据


var e = 99;
var t = `MSIE 93`;
var ie = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(t);
ie != null && (e = parseFloat(RegExp.$1));
// 93

console.log(ie);
// (2) ["MSIE 93", "93", index: 0, input: "MSIE 93", groups: undefined]
console.log(ie[0]);
// "MSIE 93"
console.log(RegExp.$1);
// " "

字符串

var e = 99;
var t = `MSIE 93`;
var ie = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(t);
ie != null && (e = parseFloat(RegExp.$1));
// 93

console.log(ie);
// (2) ["MSIE 93", "93", index: 0, input: "MSIE 93", groups: undefined]
console.log(RegExp.$1);
// "93"
console.log(RegExp.$1);
// ""

env



不需要了。️

zlwx9yxi

zlwx9yxi1#

Chrome金丝雀版本bug

测试OK

版本78.0.3904.108(Official Build)(64-bit)
x1c 0d1x的数据


相关问题