From b23e3e954860f0a2ccb6a15d3f7444cb4da3e814 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 27 Sep 2025 15:49:25 -0700 Subject: fix(rules): RegExp matching logic --- src/umabot/rules/umaddit_removal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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.""" -- cgit v1.2.3