Skip to content
Kellerman81 edited this page Dec 21, 2025 · 3 revisions

Regex Configuration

Regex patterns allow you to filter releases by requiring or rejecting specific patterns in release names. This is configured per quality template indexer.

Overview

Regex filters are defined in regex templates and then linked to quality templates. Each indexer in a quality template can reference a regex template for custom filtering.

Configuration

General Parameters

  • name: Unique identifier for the regex template

Filter Parameters

  • rejected: Array of regex patterns - releases matching ANY pattern will be rejected
  • required: Array of regex patterns - releases must match ALL patterns to be accepted (if specified)

Example Configuration

[[regex]]
name = "en_series_filter"
rejected = [
  "(?i)(\\b|_)(2160p|810p|360p|pal|ntsc)(\\b|_)",
  "(?i)(\\b|_)(bonus|trailer|sample)(\\b|_)",
  "(?i)(\\b|_)extra(s)?(\\b|_)",
  "(?i)(\\b|_)(ac3)?md(\\b|_)",
  "(?i)(\\b|_)mic(dubbed)?(\\b|_)",
  "(?i)(\\b|_)(cd|disc|disk|dvd|part)[ .\\-)]?(1|2|3|4|5|9|r)(\\b|_)",
  "(?i)(_|-)(a|b|c|d)(\\b|_)",
  "(?i)(\\b|_)(imageset|get b8|1bet|galaxxxy|asap|3d|buymore)(\\b|_)",
  "(?i)(\\b|_)(fre|fr|truefr)(nch|sub|subs)?(\\b|_)",
  "(?i)(\\b|_)ita(lian)?(\\b|_)",
  "(?i)(\\b|_)spa(nish)?(\\b|_)",
  "(?i)(\\b|_)rus(ian)?(\\b|_)",
  "(?i)(\\b|_)(tur|tr)(kish)?(\\b|_)",
  "(?i)(\\b|_)(dut|nl)(ch)?(\\b|_)",
  "(?i)(\\b|_)kor(ean|sub|subs)?(\\b|_)",
  "(?i)(\\b|_)(dan|dk|pol)(ish|sub|subs)?(\\b|_)",
  "(?i)(\\b|_)swe(dish|sub|subs)?(\\b|_)",
  "(?i)(\\b|_)heb(rew|sub|subs|dub)?(\\b|_)",
  "(?i)(\\b|_)(castellano|tamil|hindi|nordic|br|japanese|chinese)(\\b|_)",
  "(?i)(\\b|_)moto(2|3)(\\b|_)",
  "(?i)(\\b|_)sub(s|bed)?(\\b|_)",
  "(?i)(\\b|_)cam(rip)?(\\b|_)",
  "(?i)(\\b|_)(webscr|screener|webscreener|ts|r5|hdcam|hqcam)(\\b|_)",
  "(?i)(\\b|_)ger(man)?(\\b|_)",
  "(?i)(\\b|_)(deu|und|wie|der|das|ein|eine)(tsch)?(\\b|_)"
]
required = []

Example: Require Specific Patterns

[[regex]]
name = "require_proper"
rejected = []
required = ["(?i)(\\b|_)(proper|repack)(\\b|_)"]

Example: Multiple Filters

# Reject non-English releases
[[regex]]
name = "english_only"
rejected = [
  "(?i)(\\b|_)(german|french|spanish|italian|russian)(\\b|_)",
  "(?i)(\\b|_)sub(s|bed)(\\b|_)"
]
required = []

# Reject low quality releases
[[regex]]
name = "no_cam"
rejected = [
  "(?i)(\\b|_)(cam|ts|tc|r5|screener)(rip)?(\\b|_)",
  "(?i)(\\b|_)hd(cam|ts)(\\b|_)"
]
required = []

# Require specific release groups
[[regex]]
name = "trusted_groups"
rejected = []
required = ["(?i)-(SPARKS|NTb|ROVERS|DEFLATE|FLUX)$"]

Linking Regex to Quality Templates

Regex templates are linked to indexers within quality templates:

[[quality]]
name = "HD"
# ... other quality settings ...

  [[quality.quality_indexer]]
  indexer = "nzbgeek"
  template_downloader = "sabnzbd"
  template_path = "movies"
  template_regex = "english_only"  # Links to regex template by name
  # ... other indexer settings ...

Regex Pattern Guide

Common Pattern Elements

  • (?i): Case-insensitive matching
  • \b: Word boundary
  • _: Underscore (common in release names)
  • (a|b|c): Match any of a, b, or c
  • (pattern)?: Optional pattern
  • [abc]: Character class - matches a, b, or c
  • \.: Literal dot (escaped)

Common Filters

Language Filters:

(?i)(\\b|_)(german|french|spanish|italian)(\\b|_)
(?i)(\\b|_)sub(s|bed)?(\\b|_)

Quality Filters:

(?i)(\\b|_)(cam|ts|screener)(rip)?(\\b|_)
(?i)(\\b|_)(360p|480p|2160p)(\\b|_)

Unwanted Content:

(?i)(\\b|_)(sample|trailer|bonus)(\\b|_)
(?i)(\\b|_)extra(s)?(\\b|_)

Release Group:

-GROUP_NAME(\\b|_)
-(GROUP1|GROUP2|GROUP3)$

Testing Regex Patterns

Online Tools

  • regex101.com: Interactive regex tester with explanation
  • regexr.com: Visual regex builder and tester

API Endpoints for Testing

Check which releases are accepted/rejected:

Quality Priority Check:

GET http://server:port/api/quality/{quality_name}/{media_group}?apikey=your_key

Example:

http://localhost:9090/api/quality/HD/EN?apikey=mysecure

Search List (Movies):

GET http://server:port/api/movies/search/list/{movie_id}?apikey=your_key

Search List (Series Episodes):

GET http://server:port/api/series/episodes/search/list/{episode_id}?apikey=your_key

RSS Search List (Movies):

GET http://server:port/api/movies/rss/search/list/{media_group}?apikey=your_key

RSS Search List (Series):

GET http://server:port/api/series/rss/search/list/{media_group}?apikey=your_key

These endpoints show:

  • All releases found
  • Which releases were accepted/rejected
  • The reason for rejection (matched pattern, quality mismatch, etc.)
  • Priority scores for accepted releases

Tips

  1. Start Simple: Begin with basic filters and add complexity as needed
  2. Test Thoroughly: Use regex testing tools before deploying
  3. Case Insensitive: Always use (?i) flag for release name matching
  4. Word Boundaries: Use \\b or _ to avoid partial matches
  5. Combine Filters: Use multiple regex templates for different purposes
  6. Required vs Rejected: rejected is OR logic (match any to reject), required is AND logic (must match all)
  7. Performance: Complex regex can slow down parsing; keep patterns efficient
  8. Common Patterns: Reuse proven patterns from the community
  9. Log Analysis: Check logs to see which patterns are triggering most often
  10. Incremental Updates: Add one pattern at a time and verify results

Common Use Cases

Block Foreign Language Releases

[[regex]]
name = "english_only"
rejected = ["(?i)(\\b|_)(german|french|spanish|italian|russian|dutch|korean|japanese|chinese)(\\b|_)"]
required = []

Block Low Quality Sources

[[regex]]
name = "no_low_quality"
rejected = [
  "(?i)(\\b|_)(cam|ts|tc|r5|screener|dvdscr|hdcam)(rip)?(\\b|_)",
  "(?i)(\\b|_)(360p|480p)(\\b|_)"
]
required = []

Require Specific Groups

[[regex]]
name = "scene_only"
required = ["(?i)-(SPARKS|NTb|ROVERS|DEFLATE|FLUX|AMRAP|SURCODE)$"]
rejected = []

Block Multi-Part Archives

[[regex]]
name = "no_split_archives"
rejected = ["(?i)(\\b|_)(cd|disc|disk|dvd|part)[ .\\-)]?(1|2|3|4|5)(\\b|_)"]
required = []

Require Proper/Repack

[[regex]]
name = "proper_only"
required = ["(?i)(\\b|_)(proper|repack)(\\b|_)"]
rejected = []

Clone this wiki locally