I have a list of list of files that I want to against a list of approved extensions.
The list of approved extensions may be either

* Mandatory or Optional

I need to handle two cases

* Check that the list of files contains all mandatory extensions
* The list of files may only contain extensions in the approved list

Have been trying with regex because some cases can be grouped together. For example `.docx` and `.doc` treated as the same

Here is what I have so far (pseudo code)

```
List<string[]> approvedExt = new List<string[]>();
// M - Mandatory 
// O - Optional 
approvedExt.Add(new[] { "pdf", "M" });
approvedExt.Add(new[] { "(docx|doc)", "M" }); //Handle as one case
approvedExt.Add(new[] { "(txt)", "O" });

//Example list
List<string> fileList = new List<string>();
fileList.Add("123.pdf");
fileList.Add("123.txt");
fileList.Add("123.xlsx");
fileList.Add("123.pdf");

//pseudo code
For each ext in approvedExt (that are Mandatory)
{
    bool checkMandatoryExt = Any file match?
    //Example code I have seen
    fileList.All(f => System.Text.RegularExpressions.Regex.IsMatch(f, pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase));
}
if (!checkMandatoryExt)
{
    //Handle Error
}

for each file in fileList
{
    bool allApprovedExt = Any patterns match?
}
if (!allApprovedExt)
{
    //Handle Error
}

```

The example file list above would fail 2 cases

* Contains a `.xlsx` file (Not in the approved ext list)
* Does contain neither a `.docx` nor `.doc` file (Mandatory extension not in the file list)

I would like to be able to pass a list of files names and a list of approved extensions and return `true`/`false` if the list files passes the two checks above.

Thank you