getOsAndObsidianUnsafePathCharsRegExp
Returns a regexp matching all unsafe characters in file names/paths.
Includes both the platform’s refused characters (getOsUnsafePathCharsRegExp) and the ones that break links (OBSIDIAN_UNSAFE_FILENAME_CHARS).
Import:
import { getOsAndObsidianUnsafePathCharsRegExp } from '@mnaoumov/obsidian-lib/validation';Signature:
function getOsAndObsidianUnsafePathCharsRegExp(isWindows: boolean | undefined, isAndroid: boolean | undefined): RegExpParameters:
| Parameter | Type | Description |
|---|---|---|
isWindows |
boolean | undefined | Whether to use the Windows character set. Defaults to Platform.isWin. |
isAndroid |
boolean | undefined | Whether to use the Android character set when isWindows is false. Defaults to Platform.isAndroidApp. |
Returns: RegExp — A regexp matching all unsafe characters in file names/paths.
Links to this page: