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.");
}
ExpressionExample String
^TestFile-.+.txt$TestFile-03Jul2019150038.txt
^FILE-(OUTPUT|INPUT|ALL)-.+.txt$FILE-OUTPUT-03Jul2019150038.txt

Regex Tools

https://regex101.com/

Last modified: July 8, 2019

Author

Comments

Write a Reply or Comment