using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^((qwarebatch[0-9]?_((g?p(tres|[fse])|lc|ra|darf?|n[edlcs]|ob|gru_intra))_)|([AG]F|[EL]?[CO]([ACDV])?|D[CIL]|NT))[0-9]{5,8}\.TXT.*";
string input = @"qwarebatch_nc_20140714.TXT
AF32503.txt
CV4130214.TXT
CA5070515.TXT
CD4130115.txt
CC4130214.TXT
DI41102.txt
qwarebatch_dar_20150602.TXT
qwarebatch_darf_20150602.TXT
DC4130214.TXT
DL4160214.TXT
EC5070515.TXT
GF41102.txt
GP41102.TXT
qwarebatch_gru_intra_20150602.TXT
qwarebatch_lc_20150602.TXT
LO4130214.TXT
NT32503.txt
qwarebatch_nd_20150602.TXT
qwarebatch_ne_20150602.TXT
qwarebatch_nl_20150602.TXT
qwarebatch_ns_20150602.TXT
qwarebatch_ob_20150602.TXT
qwarebatch_pe_20140618.TXT
qwarebatch_pf_20150602.TXT
qwarebatch2_ptres_20150602.TXT
qwarebatch_ra_20150602.TXT";
RegexOptions options = RegexOptions.IgnoreCase | 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