-
-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Milestone
Description
The problem
When using sopel.module.rule, you can have the variable $nick in the regex pattern:
r'$nickhello' # will match "Bot: hello"
r'$nick hello' # won't match "Bot: hello", but "Bot: hello" (two spaces)
The $nick variable is super confusing as it should probably accept \s* instead of \s+ so a pattern like r'$nick hello' would be way easier to read and be less prone to error.
The solution
I don't know yet. Is \s* an acceptable change? Do we need to wait until Sopel 8 for that?
Notes
More documentation about these variables is required. Also this comes from a review by @dgw on #1873 where he points out that my comment should be more visible, and not just in a corner of the test suite.