C# RegEx Pattren

  • Thread starter Thread starter Inayat72
  • Start date Start date
I

Inayat72

Guest
Hi,



I need to create Regex Pattren that filter the files.

I have Files in Directory with names like this:

SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADJMENT_REPORT.20190331.20190227_072039.csv.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL CARD...ADHAR__RISK_BY_RATING.20180630.20181018_134810.csv.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADHAR_RISK_BY_PD.20180630.20181016_065751.csv.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADHAR_RISK_BY_PD.20180630.20181018_105254.csv.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADHAR_RISK_BY_PD.20183456.20181018_105254.csv.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADHAR_RISK_BY_RATING..csv - Copy.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADHAR_RISK_BY_PD.20180630.20181022_040721.csv.txt
SIT.SERTGHportSD.SIT - CV VAN RETAIL...ADHAR__RISK_BY_RATING.20180630.20181016_074829.csv.txt


I need to get all the files which name as (VAN RETAIL) and First Date is valid date (20190331) so total 8 files but pattran should return all files other than (row 2 - name not match, row 5 not valid date in first position, row 6 no date) and remaining 5 files list return.

I try like this but its get row 5 and 6 .

Regex reg = new Regex(@"\bVAN RETAIL\.", RegexOptions.IgnoreCase);

any help appreciated.

Thanks

Continue reading...
 
Back
Top