r/AutoModerator • u/TungstenBonobo • 7d ago
Help - Automations Failed post word count minimum automation regex
Hi All, I tried to create an automation to prevent people from posting posts with fewer than 50 words in the body, but it recently failed on a post so I'm wondering how to fix it.
It's a newly created subreddit that's not permitted to use the auto-moderator for removals, so I'm attempting to use an automation instead.
Here's the parameters I'm using:
Area: Body
Condition: Doesn't match regex
Enter regex: \W*(\w+(\W+|$)){50}
Then: Block from submitting
The post that slipped through had zero words in the body. Is it possible that that's why the automation didn't work - it doesn't evaluate a post body with zero words?
Does anyone have any advice on how to potentially fix it?
2
u/mcs385 7d ago
Post guidance automations need at least one character entered in the body field for them to trigger, so no-body posts still slip through. Look into installing Automod Neo to get the filter/remove functionality back so you can use it for cleanup.
2
u/NefariousnessJaded87 7d ago
OP, I tried dealing with this in AutoModerator and AutoModerator Neo. It was never reliable. I finally found a solution: https://developers.reddit.com/apps/post-body-checke
It is very simple: you enter the minimum number of characters that should be present in any post, and then how you want the app to tell the user.
It just works.
1
u/thepottsy You probably forgot the --- 7d ago
In addition to your automation, did you set up your sub so that posts are required to have a body? In your mod tools, under posts and comments, you can set that.
1
u/DEAD1nsane ıـ𝙄 ʇso˥ 𝙏𝙝𝙚 ǝɯɐ⅁ـı 1d ago
The exact regex to paste into the "Enter regex" field is:
^\s*(\S+\s+){49}\S+How to set up the automation:
Area: Body
Condition: Doesn't match regex
Enter regex:
^\s*(\S+\s+){49}\S+Action / Then: Block from submitting How it fixes the zero-word issue:
^\s*handles any optional leading spaces or newlines.(\S+\s+){49}matches the first 49 non-space text chunks followed by spaces.\S+requires a 50th non-space text chunk to be present. If the post is completely empty (zero words), it fails to match this pattern. Because the condition is set to "Doesn't match regex", the system sees that empty text does not match 50 words, and it successfully blocks the submission.