回答編集履歴
1
調整
test
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
```javascript
|
2
2
|
const text = 'before[123]';
|
3
|
-
const rep = text.replace(/(?<=before\[)
|
3
|
+
const rep = text.replace(/(?<=before\[)\d+(?=\])/g,x=>parseInt(x)+1);
|
4
4
|
console.log(rep);
|
5
5
|
```
|