Update .config.template.toml fix multiple subreddits regex#1275
Conversation
Fixing the regex for allowing multiple subreddits.
OpenSourceSimon
left a comment
There was a problem hiding this comment.
Awesome! Looks good to me, @JasonLovesDoggo Can you review it too?
|
Have you tested it? @dasbts |
I tested it in an online regex tester. It should work fine. |
|
For anyone that is getting problems on this, you gotta correct this like this: regex = "[_0-9a-zA-Z/+]+$" and not like this: regex = "[_0-9a-zA-Z '' +]+$", because '' is an escape key. |
A lot of people have this problem, can you tell more about this? And maybe open a pull request? |
|
Sure man. user @dasbts said that he corrected the line in .config.template.toml, in [reddit.thread] from regex = "[_0-9a-zA-Z]+$" to regex = "[_0-9a-zA-Z+]+$", but this does not work since the character '' is an escape key, so you have to replace '' in this updated string regex = "[_0-9a-zA-Z+]+$", with '/', like this: regex = "[_0-9a-zA-Z/+]+$". It should work then. |
|
You gotta simply replace the string in [reddit.thread] for "subreddit" in .config.template.toml from regex = "[_0-9a-zA-Z]+$" to regex = "[_0-9a-zA-Z/+]+$", maybe I am clearer. |
Description
Minor change to the regex to allow multiple subreddits to be used. Previously, it would prompt the user even if multiple subreddits was entered successfully, and only after in the terminal/CMD if the user entered it again, it would work, for that run of main.py. This solves the issue as there was a missing part of the regex.
Issue Fixes
#1193
#1020
Probably more issues too, and we have discussed it in the Discord.
Checklist:
Any other information (e.g how to test the changes)
Change the [reddit.thread] config for "subreddit" in .config.template.toml from regex = "[_0-9a-zA-Z]+$" to regex = "[_0-9a-zA-Z\+]+$"