Task: Fix Sporadic RegExp.exec() Null Returns in JavaScript
Task: Fix Sporadic RegExp.exec() Null Returns in JavaScript: a task in Terminal-Lego-15k (Harbor dataset). You are debugging a JavaScript program that uses regular expressions to find matches in an array of strings. The code is supposed to find all occurrences of "cat" or "dog" in each string, but…
The task
You are debugging a JavaScript program that uses regular expressions to find matches in an array of strings. The code is supposed to find all occurrences of "cat" or "dog" in each string, but the `exec()` method is sporadically returning `null` for strings that clearly contain matches.
Part of PrimeIntellect/Terminal-Lego-15k.