mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	Simplify regex to avoid catastrophic backtracking
This commit is contained in:
		
							parent
							
								
									935525e77a
								
							
						
					
					
						commit
						8befab5b5d
					
				@ -314,7 +314,7 @@ namespace Emby.Naming.Common
 | 
			
		||||
                // This isn't a Kodi naming rule, but the expression below causes false positives,
 | 
			
		||||
                // so we make sure this one gets tested first.
 | 
			
		||||
                // "Foo Bar 889"
 | 
			
		||||
                new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?<seriesname>(\w+\s*?)*)\s(?<epnumber>\d{1,3})(-(?<endingepnumber>\d{2,3}))*[^\\\/]*$")
 | 
			
		||||
                new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?<seriesname>[\w\s]+?)\s(?<epnumber>\d{1,3})(-(?<endingepnumber>\d{2,3}))*[^\\\/]*$")
 | 
			
		||||
                {
 | 
			
		||||
                    IsNamed = true
 | 
			
		||||
                },
 | 
			
		||||
@ -337,7 +337,7 @@ namespace Emby.Naming.Common
 | 
			
		||||
                // *** End Kodi Standard Naming
 | 
			
		||||
 | 
			
		||||
                // [bar] Foo - 1 [baz]
 | 
			
		||||
                new EpisodeExpression(@".*?(\[.*?\])+.*?(?<seriesname>(\w+\s*?)+?)[-\s_]+(?<epnumber>\d+).*$")
 | 
			
		||||
                new EpisodeExpression(@".*?(\[.*?\])+.*?(?<seriesname>[\w\s]+?)[-\s_]+(?<epnumber>\d+).*$")
 | 
			
		||||
                {
 | 
			
		||||
                    IsNamed = true
 | 
			
		||||
                },
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user