using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(?!deal_string)[a-m].*$";
string input = @"assets/filename.ext -> pass
deal_string/filename.ext -> fail
deal_string.ext -> fail
deal_string_1.ext -> fail
deal_draft.txt -> pass
assets_deal_string.txt -> pass
bombay.txt -> pass
zombie.srt -> fail
some_deal_string.txt -> fail
zobie_special_string.txt -> fail";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx