pub static SOURCE_REGEX: Lazy<Regex>Expand description
Source-class detector. Ported from QualityParser.cs:17-30.
The C# pattern uses three negative lookarounds inside the bluray and
webdl branches:
BD(?!$)(bluray branch). BareBDonly counts when not at end of string. Rust workaround: relaxed toBD;match_sourcerejects abluraymatch whose entire captured text isBDand ends at the input boundary.(?-i:WEB)$(webdl branch). Case-sensitive uppercaseWEBat end of input. Rust regex DOES support(?-i:...)flag-disable groups, so this is ported verbatim.(?:AMZN|NF|DP)[. -]WEB[. -](?!Rip)(webdl branch). Provider tag followed byWEBand a separator that is notRip. Rust workaround: drops the(?!Rip)and wraps the provider alternative in a nested named sub-capture(?P<provider_web>...).match_sourcethen gates the post-match(?!Rip)filter onprovider_web.is_some(), structurally identifying which alternation branch fired rather than relying on alternation order or prefix heuristics.
Callers reach a fully-correct match through [super::match_source];
the raw SOURCE_REGEX is exported for tests that want to assert which
branch the alternation hit (named groups: bluray, webdl, webrip,
hdtv, bdrip, brrip, dvd, dsr, pdtv, sdtv, tvrip).