这次全局搜索会输出什么?

来自 正则表达式
Node 24 入门 3分钟

这次全局搜索会输出什么?

JavaScript
const input = "A12 B345";
const digits = /\d+/g;
const found = [...input.matchAll(digits)]
  .map((match) => `${match[0]}@${match.index}`)
  .join(", ");

console.log(found);
在试验场中打开
报告错误