Regex Filtering Techniques for Torrent RSS Feeds

Torrent RSS downloaders rely on regular expressions (regex) to automate the filtering and downloading of media files based on release titles. Using precise regex patterns prevents accidental downloads of incorrect resolutions, unwanted release groups, low-quality recordings, or duplicate episodes. This guide outlines the essential regex filtering techniques used in torrent clients like qBittorrent, ruTorrent, and automated tools like Flexget to achieve exact matching.

1. Handling Separators with Character Classes

Release titles frequently use dots, spaces, underscores, or hyphens interchangeably (e.g., Show.Name, Show_Name, or Show Name). Hardcoding spaces or dots often leads to missed matches.

To match any standard separator, use a character class:

Show[._\s-]Name

Alternatively, using the shorthand [.\s_-]+ allows for multiple consecutive delimiters.

2. Precise Season and Episode Matching

A common pitfall in RSS matching is capturing season packs when looking for single episodes, or capturing double-digit seasons incorrectly.

3. Quality and Codec Filtering via Alternation

Torrents are released in various formats and codecs. Using alternation (|) inside non-capturing groups (?:) allows filtering for acceptable quality parameters without cluttering the match.

4. Negative Lookahead for Exclusion

Most RSS downloaders feature separate “Must Not Contain” fields, but inline regex using negative lookaheads (?!...) allows advanced conditional logic inside a single rule.

5. Multi-Condition Matching with Positive Lookahead

When a release title can have tags listed in unpredictable orders, sequential regex might fail. Positive lookaheads (?=...) allow matching multiple required tags anywhere in the title.

6. Case Insensitivity Flags

Most BitTorrent client RSS engines apply case-insensitive matching by default. If manual control is supported by the regex engine (PCRE), prepend (?i) to ignore case variations:

(?i)^Show\.Name\.S01E\d{2}

Complete Filter Examples