Skip to content

getOsAndObsidianUnsafePathCharsRegExp

Returns a regexp matching all unsafe characters in file names/paths.

Includes both OS-specific restrictions and Obsidian-specific ones.

Import:

import { getOsAndObsidianUnsafePathCharsRegExp } from 'obsidian-dev-utils/obsidian/validation';

Signature:

function getOsAndObsidianUnsafePathCharsRegExp(isWindows: boolean | undefined): RegExp

Parameters:

ParameterTypeDescription
isWindowsboolean | undefinedWhether to include Windows-specific restrictions. Defaults to Platform.isWin.

Returns: RegExp — A regexp matching all unsafe characters in file names/paths.