Safely handle a capable value as a RegExp.
If the value is a string, it will be converted to a RegExp. If the value is already a RegExp, it will be returned as is. Otherwise, an error will be thrown.
If the value is not a string or RegExp.
Safely handle a capable value as a RegExp.
If the value is a string, it will be converted to a RegExp. If the value is already a RegExp, it will be returned as is. Otherwise, an error will be thrown.