74

Edits with hair don't stick

As you can see I made an edit but it won't stick and gets deleted right away; another user with 20k rep also tried to make the same edit with no luck.

This is the answer where it happened. Also I have copied it to the answers in this question; feel free to try and edit it by adding Hair, to the front.

4
  • 7
    Probably caused by the auto salutations removal.
    – Antony
    Oct 21, 2015 at 3:58
  • 51
    Off the top of my head, pretty sure this is powered by a regex, so fixing this will potentially be a ... ⌐■_■ ... hairy situation.
    – Adam Lear StaffMod
    Oct 21, 2015 at 4:05
  • "Answer's"..? :( Oct 28, 2015 at 1:38
  • 7
    This is not a bug but an obviously correct implementation of the no-hair-theorem
    – Dilaton
    Nov 7, 2015 at 14:37

5 Answers 5

31

Hair,

You can get a temporary workaround by adding an invisible comment using <!-- --> at the beginning of your answer. Then you can add 'Hair' after it. I agree though that this needs to be fixed.

7
  • 1
    Making it bold also works. Oct 21, 2015 at 19:30
  • or adding <img></img> before
    – Aequitas
    Oct 22, 2015 at 2:22
  • @ShadowWizard Yes, but you can see that. This is invisible.
    – wythagoras
    Oct 22, 2015 at 16:40
  • See here, adding unicode character "Zero Width Space" also works. I'll post a comment consisting only of those so it's easier to copy, let me try.. oh, not making it easier to copy. Ways to type this character are described here. :) Oct 22, 2015 at 17:44
  • 15
    ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ Oct 22, 2015 at 17:44
  • @ShadowWizard and here if you're not using a laptop keyboard, ie alt08203
    – Aequitas
    Oct 23, 2015 at 3:31
  • @ShadowWizard - surely you meant bald*= Oct 24, 2015 at 9:10
17

We have performed a Hair removal removal. Having said that:

http://www.youtube.com/watch?v=ozQ8qLMKW_s#t=1m28s

Hair is no longer trimmed, cut, stripped, or buzzed.

2
  • 4
    Is there any hope that Jeff Atwood's answer will be updated to include the new regex?
    – user642796
    Nov 16, 2015 at 18:49
  • The link is (effectively) broken - "This video isn't available anymore" Mar 31, 2022 at 12:19
12

Considering the regex used seems to be:

^                 # begins at start of body
\s*               # possible spaces
(
hii?(?![a-z])|    # any of these greeting words
hello|
h(e|a)y(?![a-z])|
dear|
greetings|
hai|
guys|
howdy|
h(i|e)ya|
hola
)
.*?               # followed by anything, up to...
(
[.,;!-]+          # one or more bits of punctuation
\s*               # possible spaces
|
(\r?\n)+          # one or more newlines
)

Replacing the .*? by something that matches less should fix it. My suggestions:

  • (\W.*?)? makes sure that any of the bad words is followed by a non-word character before matching anything else
  • \b.*? makes sure we're at a word boundary before matching the rest

Putting it together and removing superfluous bits

^                 # begins at start of body
\s*               # possible spaces
(                 # any of the following greeting words
h[ai]i?|
hello|
h[eai]ya?|
dear|
greetings|
hai|
guys|
howdy|
hola
)
\b                # word boundary, to not match words that begin with a bad word
.*?               # followed by anything, up to...
(
[.,;!-]+          # one or more bits of punctuation
\s*               # possible spaces
|
[\r\n]+          # one or more newlines
)

Of course, you should check this against your unit tests. You do use unit tests, don't you?

And this would still match a useful answer on [workplace.se] that reads

Greetings should be exchanged as soon as you enter the room for your interview.

or

Dear or howdy is much too informal for a letter to a supplier.

or, over on [musicfans.se]

Guys 'n' Dolls is probably the band you're looking for.

So I agree that a pop-up alerting the user might be better.

1
11

The icy ball form of precipitation - induce the same bug.

The regex is attempting to defeat an initial "hai" (as in o hai), but it is overzealous.

The regex being:

^                 # begins at start of body
\s*               # possible spaces
(
hii?(?![a-z])|    # any of these greeting words
hello|
h(e|a)y(?![a-z])|
dear|
greetings|
hai|
guys|
howdy|
h(i|e)ya|
hola
)
.*?               # followed by anything, up to...
(
[.,;!-]+          # one or more bits of punctuation
\s*               # possible spaces
|
(\r?\n)+          # one or more newlines
)
6
  • 1
    Running that regex against /usr/share/dict/words, the only problematic entry is hai, which matches a variety of "hail" and "hair" words (plus "Haiti" and "Haitian"). dear matches a few, but they're all uncommon or are derivatives of "dear" such as "dearest". Nothing else generates false positives.
    – Mark
    Oct 24, 2015 at 1:52
  • 1
    Running it against the list of article titles on Wikipedia, hai is again the main problem one, although hola generates a fair few false positives as well. dear and hello generate a bunch of hits, but they're almost all titles in the form of greetings, except for variations on "Dearborn".
    – Mark
    Oct 24, 2015 at 1:57
  • 3
    How about hay, in a hypothetical answer on the bio stack, on what to feed cows?
    – SQB
    Oct 25, 2015 at 23:01
  • 9
    Hay una problema with banning "hay" for the Spanish site too, probably Oct 26, 2015 at 10:53
  • 4
    The regex should not modify the post text but just display a popup saying "Please don't include salutations" or something alike. This would 1) educate the user, and 2) allow for legitimate word usage in case of false positive.
    – Konamiman
    Oct 26, 2015 at 11:57
  • 2
    looool do people really try to start posts with "hai"???? (wow that regex is terrible... at least chuck in a \b for goodness's sake!!!) Oct 28, 2015 at 1:39
10

Hair, and particularly facial hair, is a sort of defense. It's harder to take a bite of someone's throat, or scratch their throat if it's covered in hair.

So in a jungle setting there can be predators that prey on humans, but if they have longer facial hair they will be more likely to survive.

(c.f. https://doi.org/10.1093/iob/obaa005 )

Granted this doesn't depend on how fast it is, so an additional thing could be that there is a micro organism that feeds of dead cells (which includes hair) so it is impossible to grow a beard very long because it gets all eaten after a certain amount of time. In this case the faster that the hair grows the longer the beard can be and thus the more protection it offers the person and thus increases their chance of survival.

8
  • 1
    I don't get the point of this answer, nor all the edits. Oct 21, 2015 at 8:01
  • 4
    @PatrickHofman - the point is testing the limits of the hairy bug. Oct 21, 2015 at 8:20
  • @PatrickHofman consider this to be posted on a Friday
    – rene
    Oct 21, 2015 at 8:23
  • 9
    The answer just proves OPs point, for testing you can use the Sandbox. Oct 21, 2015 at 8:25
  • 7
    The sandbox is not hairy enough. Oct 21, 2015 at 8:35
  • 1
    @Pat true, but actually it's convenient to have it here. OP should make it CW though. Oct 21, 2015 at 8:35
  • 4
    This must be the best off-topic answer there is Oct 21, 2015 at 23:16
  • @PythonMaster meta.stackexchange.com/a/210452/260841 ;) Oct 23, 2015 at 9:31

You must log in to answer this question.

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