Task: Implement Regex-based indexOf Methods in JavaScript
Task: Implement Regex-based indexOf Methods in JavaScript: a task in Terminal-Lego-15k (Harbor dataset). JavaScript's built-in String.indexOf() and String.lastIndexOf() methods only accept string parameters. However, there are situations where you need to find the index of a pattern match using a…
The task
JavaScript's built-in `String.indexOf()` and `String.lastIndexOf()` methods only accept string parameters. However, there are situations where you need to find the index of a pattern match using a regular expression, while still being able to specify a starting position (second parameter).
Part of PrimeIntellect/Terminal-Lego-15k.