HF RL Explorer

Task: Understanding JavaScript Regex Global Replace Behavior

Task: Understanding JavaScript Regex Global Replace Behavior: a task in Terminal-Lego-15k (Harbor dataset). When using JavaScript's String.prototype.replace() with a global regex pattern, unexpected results can occur. Consider this example:

The task

When using JavaScript's `String.prototype.replace()` with a global regex pattern, unexpected results can occur. Consider this example:

Part of PrimeIntellect/Terminal-Lego-15k.