Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance swear words rule to handle plurals #1

Open
dbremner opened this issue Sep 18, 2022 · 1 comment
Open

Enhance swear words rule to handle plurals #1

dbremner opened this issue Sep 18, 2022 · 1 comment

Comments

@dbremner
Copy link

dbremner commented Sep 18, 2022

Hello,
I'm not sure if it's worth a pull request, but here's a modified version of your Swear Words rule that uses regular expressions to add plural forms and support multiple spaces between words. The "?" operator makes the last match or character optional. The pattern "books?", for example, matches either "book" or "books". The "\s" matches whitespace characters such as space, tab, etc. The "+" operator makes the last pattern or character match one or more occurrences. Combining these together gives you "\s+" which matches one or more whitespace characters.

#Swear Words
    type: comment
    body (includes-word, regex): ['cheap\s+fucks?', 'fuck\s+you', 'bullshit', 'niggers?', 'faggots?', 'fags?', 'bitchery', 'fuckery']
    action: filter
    action_reason: Inappropriate comments.
---
@UTDallasRedditMod
Copy link
Contributor

Awesome, thanks for the tip. I'll work on adding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants