A function to properly handle escape sequences in a Regex pattern string, so it can be safely used with the RegExp constructor.
RegExp
The Regex pattern to escape.
A new string with escape sequences properly handled.
A function to properly handle escape sequences in a Regex pattern string, so it can be safely used with the
RegExpconstructor.