using System.Text.RegularExpressions;
if (!Regex.IsMatch(fileName, FileNamePattern, RegexOptions.IgnoreCase))
{
// Filename does not match file name pattern.
log.Info($"{fileName} doesn't match the file name pattern '{FileNamePattern}'. File skipped.");
}
Expression | Example String |
^TestFile-.+.txt$ | TestFile-03Jul2019150038.txt |
^FILE-(OUTPUT|INPUT|ALL)-.+.txt$ | FILE-OUTPUT-03Jul2019150038.txt |
Regex Tools
Comments