From 06309bae353798ba95dc9a225e228cda7a327eab Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Wed, 11 Jan 2023 22:41:17 -0800 Subject: [PATCH] double-backslash --- src/ytdl_sub/plugins/regex.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ytdl_sub/plugins/regex.py b/src/ytdl_sub/plugins/regex.py index 73e97ac9..51269083 100644 --- a/src/ytdl_sub/plugins/regex.py +++ b/src/ytdl_sub/plugins/regex.py @@ -105,8 +105,9 @@ class RegexOptions(PluginOptions): r""" Performs regex matching on an entry's source variables. Regex can be used to filter entries from proceeding with download or capture groups to create new source variables. NOTE to - use backslashes anywhere in your regex, i.e. `\d`, you must add another backslash escape, - meaning `\d` becomes `\\d`. This is because YAML requires an escape for any backslash usage. + use backslashes anywhere in your regex, i.e. ``\d``, you must add another backslash escape. This + means ``\d`` should be written as ``\\d``. This is because YAML requires an escape for any + backslash usage. Usage: @@ -124,9 +125,10 @@ class RegexOptions(PluginOptions): # For each entry's `title` value... title: # Perform this regex match on it to act as a filter. - # This will only download videos with "Official Video" in it. + # This will only download videos with "[Official Video]" in it. Note that we + # double backslash to make YAML happy match: - - '\[Official Video\]' + - '\\[Official Video\\]' # For each entry's `description` value... description: