Browse Source

Remove extra capture group from regex

https://regex101.com/r/bn9IOy/11/
Bond_009 6 years ago
parent
commit
c05e8088d6
1 changed files with 1 additions and 3 deletions
  1. 1 3
      MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs

+ 1 - 3
MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs

@@ -139,7 +139,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
 
             var required = codec == Codec.Encoder ? requiredEncoders : requiredDecoders;
 
-            Regex regex = new Regex(@"\s\S{6}\s(?<codec>(\w|-)+)\s{3}");
+            Regex regex = new Regex(@"\s\S{6}\s(?<codec>[\w|-]+)\s{3}");
 
             MatchCollection matches = regex.Matches(output);
 
@@ -147,8 +147,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 .Select(x => x.Groups["codec"].Value)
                 .Where(x => required.Contains(x));
 
-            //var found = required.Where(x => output.IndexOf(x, StringComparison.OrdinalIgnoreCase) != -1);
-
             _logger.LogInformation("Available {Codec}: {Codecs}", codecstr, found);
 
             return found;