From 9e2e459cc2be09bfe94aa098525a97fcc62ad7a8 Mon Sep 17 00:00:00 2001 From: Snarling <84951833+Snarling@users.noreply.github.com> Date: Wed, 17 Aug 2022 08:14:15 -0400 Subject: [PATCH] Allow & and ' in filenames --- src/Terminal/DirectoryHelpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Terminal/DirectoryHelpers.ts b/src/Terminal/DirectoryHelpers.ts index 1f8b200fd..067b80949 100644 --- a/src/Terminal/DirectoryHelpers.ts +++ b/src/Terminal/DirectoryHelpers.ts @@ -38,7 +38,7 @@ export function removeTrailingSlash(s: string): string { export function isValidFilename(filename: string): boolean { // Allows alphanumerics, hyphens, underscores, and percentage signs // Must have a file extension - const regex = /^[.a-zA-Z0-9_-]+[.][a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/; + const regex = /^[.&'a-zA-Z0-9_-]+\.[a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/; // match() returns null if no match is found return filename.match(regex) != null;