aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-27 15:49:25 -0700
committerFuwn <[email protected]>2025-09-27 15:49:33 -0700
commitb23e3e954860f0a2ccb6a15d3f7444cb4da3e814 (patch)
tree37ce8753d4a6b2b37b1288be63d08969659cf8d5
parentfix(irm): Improve model evaluation (diff)
downloadumabot-b23e3e954860f0a2ccb6a15d3f7444cb4da3e814.tar.xz
umabot-b23e3e954860f0a2ccb6a15d3f7444cb4da3e814.zip
fix(rules): RegExp matching logic
-rw-r--r--src/umabot/rules/umaddit_removal.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/umabot/rules/umaddit_removal.py b/src/umabot/rules/umaddit_removal.py
index d4578df..759c784 100644
--- a/src/umabot/rules/umaddit_removal.py
+++ b/src/umabot/rules/umaddit_removal.py
@@ -13,8 +13,8 @@ class UmadditRemovalRule(Rule):
super().__init__(config)
# Regex pattern to match subreddit references to umaddit
# Matches: r/umaddit, /umaddit (case-insensitive)
- # Word boundaries ensure we don't match "forumaddit" or similar
- self.umaddit_pattern = re.compile(r'\b(?:r/|/)umaddit\b', re.IGNORECASE)
+ # Word boundary after umaddit ensures we don't match "umaddit123" or similar
+ self.umaddit_pattern = re.compile(r'(?:r/|/)umaddit\b', re.IGNORECASE)
def should_remove(self, submission: praw.models.Submission) -> bool:
"""Check if a post contains umaddit subreddit references."""