![regex golf it never ends regex golf it never ends](https://www.practicalecommerce.com/wp-content/uploads/2018/09/Pasted_Image_9_22_18__7_41_PM.jpg)
Exactly what the pattern implicit in the question is may sometimes be somewhat ambiguous, or there might be different levels of robustness. The highest-scoring solution may not be exact, because the advantage of being more compact may outweigh the disadvantage of either missing one or more matches or making one or more incorrect matches or both.Ī solution is robust if, in addition to being exact, it would continue to be exact if the test data were to include further examples following the pattern implicit in the question. I suggest the following terms:Ī solution is exact if it matches all the strings in the left column and does not match all the strings in the right column. Erling seems to contrast "cheat" with "exact", so I think he's referring to solutions which don't fully discriminate but which score higher than other solutions that do fully discriminate because of the scoring system - what we might call a 'tactical failure'. Sorry, something went good question, I think there are several types of "cheating" we can think about. Others discovered my other solutions first, so I don't have anything else to / Upon seeing a 17-character solution to Powers, my first thought was "WTF?" Upon working through it, my hat is off to you, that is elegant. This is the solution I ended up using for scoring although I see now that others have trumped me well played! ^(?!.*\b((.*)n.*\b\2|(.*)r.*\b\3|(.*)s.*\b\4|(.*)t.*\b\5))
![regex golf it never ends regex golf it never ends](https://i.stack.imgur.com/rDsF4.png)
I consider this cheating, but your mileage may vary. But by my own standards, this is a cheat-free solution, and I haven't seen any others that meet that standard. I haven't even considered the case where the words are of varying lengths, but my brain is done for tonight.
![regex golf it never ends regex golf it never ends](https://i.imgur.com/MZN3ON9.png)
My solution there cheats a lot (it matches far more than the intended binary nibble count sequence, just happens to not match any of his counter examples because none of them swap more than 1 nibble out).Īlphabetical (-109) "Pure" solution: Should work for any number of words of any length limited to characters. I want to know what the meaning of the hitchhikers guide reference in long count v2 is all about. Anything beyond that I feel is cheating so badly that it doesn't matter how much more you do. I stand corrected, ty could create the brute force expression of every possible 6 letter word in order containing the letters aenrst (which is still terribly long), or the one containing all the words in this list (-69 points, goes: ^(aerate ?)*(arrest ?)*.$ and is 409 characters long). I guess the hint is a reference back to #9 which is possible without cheating (even though it says to cheat). I don't think it is possible to create a regular expression that matches any list of words in alphabetical order (one of 6 letter combinations only would be incredibly long).