escapeRegex(str)
Escapes special regex characters in a string.
Parameters:
str(string) – Input string.
Returns: Escaped string safe for regex.
Example:
1const escaped = micromatch.escapeRegex("file?.txt"); // "file\?.txt"
Escapes special regex characters in a string.
Parameters:
str (string) – Input string.Returns: Escaped string safe for regex.
Example:
1const escaped = micromatch.escapeRegex("file?.txt"); // "file\?.txt"