Task: Fix RegExp with Global Flag Behavior in JavaScript
Task: Fix RegExp with Global Flag Behavior in JavaScript: a task in Terminal-Lego-15k (Harbor dataset). In JavaScript, when a RegExp object is created with the global ( g ) flag, the lastIndex property is updated after each successful match. This causes subsequent calls to .test() or .exec() on…
The task
In JavaScript, when a `RegExp` object is created with the global (`g`) flag, the `lastIndex` property is updated after each successful match. This causes subsequent calls to `.test()` or `.exec()` on the same RegExp object to start searching from the position of the last match rather than from the beginning of the…
Part of PrimeIntellect/Terminal-Lego-15k.