Skip to content

Enhance swear words rule to handle plurals #1

@dbremner

Description

@dbremner

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.
---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions