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
If we are playing that language game.