18 using System.Runtime.CompilerServices;
19 using System.Text.RegularExpressions;
32 private static readonly Regex ToValidWindowsPathRegex =
new Regex(
"((?<=(\\\\|/|^))(CON|PRN|AUX|NUL|(COM[0-9])|(LPT[0-9]))(?=(\\.|\\\\|/|$)))", RegexOptions.IgnoreCase | RegexOptions.Compiled);
34 private static readonly
bool _isWindows =
OS.
IsWindows;
40 [MethodImpl(MethodImplOptions.AggressiveInlining)]
43 return _isWindows ? ToValidWindowsPathRegex.Replace(path, _fixPathRegex) : path;
50 [MethodImpl(MethodImplOptions.AggressiveInlining)]