Radarr/Radarr · error · ArgumentException
Unknown or unsupported perl regex modifier: {0}
Error message
Unknown or unsupported perl regex modifier: {0} What it means
Thrown by PerlRegexFactory when parsing a Perl-style release profile regex and encountering a modifier character not in the supported set (i, m, s, x, n, etc.). The unsupported character is appended to the message. .NET RegexOptions cannot represent every Perl modifier, so Radarr rejects unknown ones.
Source
Thrown at src/NzbDrone.Core/Profiles/Releases/PerlRegexFactory.cs:61
case 's':
options |= RegexOptions.Singleline;
break;
case 'i':
options |= RegexOptions.IgnoreCase;
break;
case 'x':
options |= RegexOptions.IgnorePatternWhitespace;
break;
case 'n':
options |= RegexOptions.ExplicitCapture;
break;
default:
throw new ArgumentException("Unknown or unsupported perl regex modifier: " + modifier);
}
}
return options;
}
}
}
View on GitHub (pinned to ca451608dc)
Solutions
- Remove the unsupported modifier from the regex flag suffix — keep only i, m, s, x, n.
- For global matching needs ('g'), note Radarr applies the regex per-release, so 'g' is unnecessary.
- For Unicode behavior ('u'), .NET regex is Unicode-aware by default; drop the modifier.
- Re-save the release profile after correcting the flags.
Example fix
// before: /pattern/ige -> 'e' (eval) unsupported // after: /pattern/i
Defensive patterns
Strategy: validation
Validate before calling
static readonly HashSet<char> SupportedFlags = new() { 'i','m','s','x','n' };
if (modifier != '\0' && !SupportedFlags.Contains(modifier)) {
throw new ValidationFailure("Regex", $"Unsupported perl modifier '{modifier}'");
} Type guard
static bool IsValidPerlModifier(char c) => "imsxn".IndexOf(c) >= 0;
Try / catch
try { regex = PerlRegexFactory.Create(pattern); }
catch (ArgumentException ex) when (ex.Message.Contains("perl regex modifier")) {
_logger.Warn(ex, "Release-profile regex has unsupported modifier; falling back to no flags");
regex = new Regex(StripFlags(pattern));
} Prevention
- Restrict perl modifiers to i, m, s, x, n (the .NET-mappable set).
- Avoid copy-pasting regex with PCRE-specific flags (e, g, u, a).
- Strip unknown flags before saving shared release profiles.
- Test regex in the release-profile editor before saving.
When it happens
Trigger: A release profile's 'Must Contain' / 'Must Not Contain' / 'Preferred' regex uses a Perl-style /pattern/FLAGS suffix with a flag character outside the recognized set (e.g. 'e', 'g', 'p', 'l', 'u', 'a', 'd').
Common situations: Copying regex from a Perl/PCRE tutorial or another indexer tool that supports flags Radarr/.NET does not, importing a shared release profile with PCRE-specific modifiers, or a typo in the flag suffix.
Related errors
- Strm Folder needs to be set for Pneumatic Downloader
- Invalid Webhook method {settings.Method}
- Invalid Host
- Remote Path must not start with a space
- Invalid RemotePath. RemotePath cannot be empty.
AI-assisted analysis of Radarr/Radarr@ca451608dc (2026-08-13).
Data as JSON: /api/errors/64fd96fc1cd67a3e.
Report an issue: GitHub.