If we are playing that language game.
yes, but that produces false positives, whereas both 'apex|ibex|index' and '(ap|ib|ind)ex' do not.
Your original claim was that 'apex|ibex|index' was "simplest", which means it has some property you think that '(ap|ib|ind)ex' lacks, but you haven't yet articulated what that IS.
And the simplest to produce algorithmically.
To prove it, extend each regex to include “indices”.
Being less clever, it is simpler to debug.
If I saw that list, I'd certainly assume there was something special about the "ex" ending since they don't otherwise have much in common and it's extremely unlikely for random chance to produce three "-ex" words just by chance. The shorter regex does a good job of highlighting that yes, "-ex" is the relevant criteria we care about.
I just picked three words I fancied at the time I was illustrating my point. Not random, but not because -ex was important. The language game I was playing was writing an HN comment for amusement.
The finite state machine of my regular expression has one fewer nodes than yours. If that ain’t simpler it will do until simpler shows up.
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? — Brian Kernighan
There is no offside in golf...yet. But the rules are surprisingly long, and will only get longer as loopholes are found and exploited. Humans trying to codify a game, or any system, cannot do so precisely; others can and will find the gaps between the written rules and the intended meaning, and play a different game but pretend it's the same. Or I guess, every game is a language game?
Which I think is a point of meta rationality: we can't avoid including questions of the rules of the problem. It's clouds all the way down.