obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
20 lines (19 loc) • 614 B
text/typescript
/**
* @packageDocumentation
*
* Contains utility functions for regular expressions.
*/
/**
* Escapes special characters in a string to safely use it within a regular expression.
*
* @param str - The string to escape.
* @returns The escaped string with special characters prefixed with a backslash.
*/
export declare function escapeRegExp(str: string): string;
/**
* Checks if a string is a valid regular expression.
*
* @param str - The string to check.
* @returns `true` if the string is a valid regular expression, `false` otherwise.
*/
export declare function isValidRegExp(str: string): boolean;