I noticed this allocates too much: https://github.com/dotnet/msbuild/blob/4b2d01ad2b0ef3ee4a05ed29ff1ec2b558b51f17/src/Shared/FileMatcher.cs#L1498  Let's investigate if we can cache these regexes, I suspect there's a very limited number of expressions here that we can reuse regexes for