Task: Implement a RegExp.escape Function in JavaScript
Task: Implement a RegExp.escape Function in JavaScript: a task in Terminal-Lego-15k (Harbor dataset). JavaScript does not have a built-in RegExp.escape() function to escape special regular expression characters in a string. When creating a regular expression from user input or arbitrary strings…
The task
JavaScript does not have a built-in `RegExp.escape()` function to escape special regular expression characters in a string. When creating a regular expression from user input or arbitrary strings, special characters like `?`, `*`, `+`, `(`, `)`, `[`, `]`, `{`, `}`, `|`, `\`, `^`, `$`, and `.` need to be escaped to be…
Part of PrimeIntellect/Terminal-Lego-15k.