Safely embed user input in regex patterns ๐
RegExp.escape() escapes regex syntax characters in a string, so you can use user-provided text as a literal pattern.
Prevents unexpected regex behavior and security issues when dynamically creating RegExp patterns.
Learn more here ๐
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape
