The string value to be escaped and converted into a RegExp for literal matching.
A new Regular Expression that matches the literal string value.
let regex = createLiteralRegex("Hello.World");
let matches = regex.exec("Hello.World");
matches[0]; // "Hello.World"
let matches = regex.exec("HelloXWorld");
matches; // null - dot does not match as wildcard
let regex = createLiteralRegex("(test)");
let matches = regex.exec("(test)");
matches[0]; // "(test)"
let matches = regex.exec("test");
matches; // null
Create a regular expression that escapes all special regex characters in the input string, treating it as a literal string to match.