fix up regex

This commit is contained in:
Bitl 2021-09-15 09:10:36 -07:00
parent 958d647832
commit 2445d75903
1 changed files with 2 additions and 2 deletions

View File

@ -1895,7 +1895,7 @@ public class GlobalFuncs
{ {
string fileName = Path.GetFileName(path); string fileName = Path.GetFileName(path);
if (Regex.Match(fileName, @"[^\w-.'_! ]") != Match.Empty) if (Regex.Match(fileName, @"[^\w-.'_!()& ]") != Match.Empty)
{ {
return true; return true;
} }
@ -1910,7 +1910,7 @@ public class GlobalFuncs
string pathWithoutFilename = Path.GetDirectoryName(path); string pathWithoutFilename = Path.GetDirectoryName(path);
string fileName = Path.GetFileName(path); string fileName = Path.GetFileName(path);
fileName = Regex.Replace(fileName, @"[^\w-.'_! ]", ""); fileName = Regex.Replace(fileName, @"[^\w-.'_!()& ]", "");
string finalPath = pathWithoutFilename + "\\" + fileName; string finalPath = pathWithoutFilename + "\\" + fileName;
FixedFileMove(path, finalPath, false); FixedFileMove(path, finalPath, false);