Repository: yt-dlp
Issue: Regex in match-filters doesn't work
Labels: bug,triage

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

Hi yt-dlp team!
I want to download videos from YT only from playlists with specific titles. For this I want to use regex in `--match-filters`. But regex don't work as I expect. I try different distro (now I use Fedora 39), yt-dlp from github and from fedora repos. And I have no idea, why it's doesn't work.

I show all playlists on the channel and I see two playlists `testplaylist` and `test playlist` (I use spaces for regex tests on purpose)
```
[debug] Command-line config: ['-vU', '--print', 'playlist_title', 'https://www.youtube.com/@maxmuller8233/playlists']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (zip)
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.11.3-100.fc39.x86_64-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1.2 (setts), ffprobe 6.1.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, mutagen-1.46.0, requests-2.28.2, sqlite3-3.42.0, urllib3-1.26.20, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[youtube:tab] Extracting URL: https://www.youtube.com/@maxmuller8233/playlists
[youtube:tab] @maxmuller8233/playlists: Downloading webpage
[debug] [youtube:tab] Selected tab: 'playlists' (playlists), Requested tab: 'playlists'
[download] Downloading playlist: Max Muller - Playlists
[youtube:tab] Playlist Max Muller - Playlists: Downloading 2 items of 2
[download] Downloading item 1 of 2
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY: Downloading webpage
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: test playlist
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
[youtube:tab] Playlist test playlist: Downloading 1 items of 1
[download] Downloading item 1 of 1
[youtube] Extracting URL: https://www.youtube.com/watch?v=kCnQ1Y6RZ-o
[youtube] kCnQ1Y6RZ-o: Downloading webpage
[youtube] kCnQ1Y6RZ-o: Downloading ios player API JSON
[youtube] kCnQ1Y6RZ-o: Downloading mweb player API JSON
[youtube] kCnQ1Y6RZ-o: Downloading player fb725ac8
[debug] Saving youtube-nsig.fb725ac8 to cache
[debug] [youtube] Decrypted nsig PlLe52Si6ctlik7g => WbSF-0g35geFgg
[debug] Loading youtube-nsig.fb725ac8 from cache
[debug] [youtube] Decrypted nsig kR6EC9SUBvXn1Ml6 => rIZHKeSKhKlk6g
[youtube] kCnQ1Y6RZ-o: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] kCnQ1Y6RZ-o: Downloading 1 format(s): 136+251
test playlist
[download] Finished downloading playlist: test playlist
[download] Downloading item 2 of 2
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3: Downloading webpage
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: testplaylist
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3 page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3 page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3 page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3 page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
[youtube:tab] Playlist testplaylist: Downloading 1 items of 1
[download] Downloading item 1 of 1
[youtube] Extracting URL: https://www.youtube.com/watch?v=kCnQ1Y6RZ-o
[youtube] kCnQ1Y6RZ-o: Downloading webpage
[youtube] kCnQ1Y6RZ-o: Downloading ios player API JSON
[youtube] kCnQ1Y6RZ-o: Downloading mweb player API JSON
[debug] Loading youtube-nsig.fb725ac8 from cache
[debug] [youtube] Decrypted nsig JZ6kSVM8Kkv0qWQG => bNPk226_r1ucuQ
[debug] Loading youtube-nsig.fb725ac8 from cache
[debug] [youtube] Decrypted nsig kmmmMYSZqq7tXNU7 => BmEtcCXsi5OKKA
[youtube] kCnQ1Y6RZ-o: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] kCnQ1Y6RZ-o: Downloading 1 format(s): 136+251
testplaylist
[download] Finished downloading playlist: testplaylist
[download] Finished downloading playlist: Max Muller - Playlists
```

### Another examples
I want print only playlist with name `testplaylist`. But I get nothing
```
[debug] Command-line config: ['-vU', '--print', 'playlist_title', '--match-filters', "playlist_title~='testplaylist'", 'https://www.youtube.com/@maxmuller8233/playlists']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (zip)
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.11.3-100.fc39.x86_64-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1.2 (setts), ffprobe 6.1.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, mutagen-1.46.0, requests-2.28.2, sqlite3-3.42.0, urllib3-1.26.20, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[youtube:tab] Extracting URL: https://www.youtube.com/@maxmuller8233/playlists
[youtube:tab] @maxmuller8233/playlists: Downloading webpage
[debug] [youtube:tab] Selected tab: 'playlists' (playlists), Requested tab: 'playlists'
[download] entry does not pass filter (playlist_title~='testplaylist'), skipping ..
```

I try another regex, but I get same result
```
[debug] Command-line config: ['-vU', '--print', 'playlist_title', '--match-filters', "playlist_title~='.*test.*'", 'https://www.youtube.com/@maxmuller8233/playlists']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (zip)
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.11.3-100.fc39.x86_64-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1.2 (setts), ffprobe 6.1.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, mutagen-1.46.0, requests-2.28.2, sqlite3-3.42.0, urllib3-1.26.20, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[youtube:tab] Extracting URL: https://www.youtube.com/@maxmuller8233/playlists
[youtube:tab] @maxmuller8233/playlists: Downloading webpage
[debug] [youtube:tab] Selected tab: 'playlists' (playlists), Requested tab: 'playlists'
[download] entry does not pass filter (playlist_title~='.*test.*'), skipping ..
```

OK, let's try don't use regex and use strict compliance
```
[debug] Command-line config: ['-vU', '--print', 'playlist_title', '--match-filters', "playlist_title='testplaylist'", 'https://www.youtube.com/@maxmuller8233/playlists']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (zip)
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.11.3-100.fc39.x86_64-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1.2 (setts), ffprobe 6.1.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, mutagen-1.46.0, requests-2.28.2, sqlite3-3.42.0, urllib3-1.26.20, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[youtube:tab] Extracting URL: https://www.youtube.com/@maxmuller8233/playlists
[youtube:tab] @maxmuller8233/playlists: Downloading webpage
[debug] [youtube:tab] Selected tab: 'playlists' (playlists), Requested tab: 'playlists'
[download] entry does not pass filter (playlist_title='testplaylist'), skipping ..
```

### Working example
BUT! If I add negation of expression it's work! yt-dlp skip playlist with name `testplaylist` and show me playlist with name `test playlist`.
```
[debug] Command-line config: ['-vU', '--print', 'playlist_title', '--match-filters', "playlist_title!='testplaylist'", 'https://www.youtube.com/@maxmuller8233/playlists']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (zip)
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.11.3-100.fc39.x86_64-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1.2 (setts), ffprobe 6.1.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, mutagen-1.46.0, requests-2.28.2, sqlite3-3.42.0, urllib3-1.26.20, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[youtube:tab] Extracting URL: https://www.youtube.com/@maxmuller8233/playlists
[youtube:tab] @maxmuller8233/playlists: Downloading webpage
[debug] [youtube:tab] Selected tab: 'playlists' (playlists), Requested tab: 'playlists'
[download] Downloading playlist: Max Muller - Playlists
[youtube:tab] Playlist Max Muller - Playlists: Downloading 2 items of 2
[download] Downloading item 1 of 2
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY: Downloading webpage
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: test playlist
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLItuMrVtCQt2IsZrfsOq2wKA3QHQyDBsY page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
[youtube:tab] Playlist test playlist: Downloading 1 items of 1
[download] Downloading item 1 of 1
[youtube] Extracting URL: https://www.youtube.com/watch?v=kCnQ1Y6RZ-o
[youtube] kCnQ1Y6RZ-o: Downloading webpage
[youtube] kCnQ1Y6RZ-o: Downloading ios player API JSON
[youtube] kCnQ1Y6RZ-o: Downloading mweb player API JSON
[debug] Loading youtube-nsig.a62d836d from cache
[debug] [youtube] Decrypted nsig Po-B41SuepJBdEQlr => 6sd2_4Xe9NBoGg
[debug] Loading youtube-nsig.a62d836d from cache
[debug] [youtube] Decrypted nsig Blli67YoiQhku_B9L => sAD6oAlo3FERxw
[youtube] kCnQ1Y6RZ-o: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] kCnQ1Y6RZ-o: Downloading 1 format(s): 136+251
test playlist
[download] Finished downloading playlist: test playlist
[download] Downloading item 2 of 2
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3: Downloading webpage
[youtube:tab] PLItuMrVtCQt2tknrMCQLSeS3NZr_R0yf3: Redownloading playlist API JSON with unavailable videos
[download] entry does not pass filter (playlist_title!='testplaylist'), skipping ..
[download] Finished downloading playlist: Max Muller - Playlists
```

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', '--print', 'playlist_title', '--match-filters', "playlist_title~='.*test.*'", 'https://www.youtube.com/@maxmuller8233/playlists']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (zip)
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.11.3-100.fc39.x86_64-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1.2 (setts), ffprobe 6.1.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.05.07, mutagen-1.46.0, requests-2.28.2, sqlite3-3.42.0, urllib3-1.26.20, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[youtube:tab] Extracting URL: https://www.youtube.com/@maxmuller8233/playlists
[youtube:tab] @maxmuller8233/playlists: Downloading webpage
[debug] [youtube:tab] Selected tab: 'playlists' (playlists), Requested tab: 'playlists'
[download] entry does not pass filter (playlist_title~='.*test.*'), skipping ..
```