27

Recently I came across the question, "Java programming homework help" (need 10K rep to see the link).

It was tagged C++ for no reason so I untagged it, but when I came to submit my edit I came across an interesting conundrum. At the time, it had "help" in the title, which is unlawful now, so the system rejected my edit.

However, the guy somehow had already asked the question with "help" in the title and dodged the filter. I didn't think to check the title because he had only just asked it- it's not like, one from before the filter existed or anything.
So I'm currently concluding that the filter must be inconsistently applied.

4
  • 5
    If it's blocked the block isn't working
    – Ben Brocka
    Apr 9, 2012 at 22:05
  • I think help is only blocked if it's at the beginning of the title, but I can't find a reference for that right now.
    – Adam Lear StaffMod
    Apr 9, 2012 at 22:17
  • help seems too broad; I've seen people asking for assistance in preparing their CHM files before...
    – sarnold
    Apr 9, 2012 at 22:28
  • 5
    That does not explain why it stopped us from submitting our edits if we left "help" in the title though.
    – Bart
    Apr 9, 2012 at 22:32

1 Answer 1

5

This is the current regex we are using:

\b((?:question(?! mark)|doubt|^help|help with|problem)\b|help[?!. ]*?$|\s*?!+\s*?$) ... note, it is subject to change.

We only block help at the begining of the title or help with,help?, help. and help! anywhere in the title.

The old regex had an issue with trailing spaces.

If we need to improve or expand the block please post a new meta question with data to back up the reasoning.

8
  • 4
    So why does removing the C++ tag from the original version give the "Oops! Your edit couldn't be submitted because:" message? I just tried it by clicking the edit link against the first version and saw the same message. Apr 10, 2012 at 6:25
  • because the original title was Java programming homework help notice the trailing space, if we want to clean the regex up I am fine to do so
    – waffles
    Apr 10, 2012 at 6:32
  • Bit early in the day to be looking at RegExs but from pasting into RegEx buddy I think your description of the behaviour is not correct. It blocks help followed by zero or more of ?!. at the end of the string only. i.e. help! in the middle of a string is not blocked. I guess changing the bit at the end to help[?!.\s]*? should deal with any trailing spaces (that presumably get trimmed after validation) if that's the desired behaviour. Apr 10, 2012 at 6:45
  • 4
    This makes no sense to me. If the edit is blocked, then the original post should have been blocked, but it wasn't. Clearly there are 2 different filters at play and the code is not DRY. Apr 10, 2012 at 7:02
  • I fixed the regex so it blocks trailing spaces
    – waffles
    Apr 10, 2012 at 7:04
  • 2
    @BrockAdams - It makes sense to me if the OP submitted with a trailing space thus bypassing the validation then later this trailing space gets trimmed. Apr 10, 2012 at 7:33
  • 2
    @MartinSmith: Good point. Burned by whitespace trimming again. However, this is still effectively 2 different filters. If WS is going to be trimmed, it should be done before filters are applied. I imagine this bug will arise again, otherwise. Apr 10, 2012 at 7:42
  • Looks like this regex is solving a question about "question" in the title I posted last year. Can you post some answer there, and mark it as status complete?
    – Igor Milla
    Apr 10, 2012 at 17:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .