This way should work too:
Regex.Matches(file.Name, "[a-z0-9]+_([a-z0-9]+[_-])*[a-z0-9]+[.]xml$", RegexOptions.IgnoreCase);
Since the suffix may be uppercase or lowercase, you need to use the Regex.Matches overload with RegexOptions as a parameter.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.