I am using System.Text.RegularExpressions.Regex.IsMatch to extract a file name. My aim is to count the number of files with names which contain the word CDA and NDA but not Edited. I have the code here:
(Directory.GetFiles(Contract.ToString,"",SearchOption.AllDirectories)).ToArray.Where(function(x) System.Text.RegularExpressions.Regex.IsMatch(x,/^(?!.“Edited”+$)(“NDA|CDA”),RegexOptions.IgnoreCase)).Count following the test on regex (which worked well)
However, the code is not working at the moment after I added the negative lookahead in. The error says “Expression expected. End of expression expected”. Is there anyway I can fix this?
Hi sorry, I am having a problem with it again as now it will not return anything after adding the negative lookahead in. I thought it worked but turnt out it failed