The value to be converted into a RegExp, if the value is not a string it will coerced to a string.
OptionalignoreCase: boolean
Flag to indicate whether the regular expression should be case-sensitive, Defaults to false.
OptionalfullMatch: boolean
Flag to identify whether the RegExp should be wrapped with '^' and '$' to
incidate match the entire string only.
The new Regular Expression created from the provided value.
let regex = createWildcardRegex("Hello*");
let matches = regex.exec("Hello");
matches[0]; // "Hello";
matches[1]; // ""
let matches = regex.exec("Hello Darkness");
matches[0]; // "Hello Darkness"
matches[1]; // " Darkness"
let matches = regex.exec("Darkness Hello");
matches[0]; // "Hello"
matches[1]; // ""
let regex.exec("Darkness Hello.");
matches[0]; // "Hello."
matches[1]; // "."
Create a simple wildcard regular expression from the string value, converting any embedded wildcard
'*'characters to match any character zero or more times (including folder seperators'/'or'\'), while escaping all other characters. The supported matching values are'*'Matches any characters zero or more times (including folder seperators ''/' or'\')Each
'*'is a(.*)group which can backtrack, so for a string which doesn't match the time grows with the length of the string to the power of the number of'*'(eg. seconds for a few KB with three'*'), and an unanchored expression (withoutfullMatch) also tries each starting position, so limit the length of an untrusted string before matching it.