# Singular or plural?

Here is a list of 30 English nouns in their singular and plural form. Your job is simply to write the shortest regular expression that matches all the nouns in one form and none in the other (easy, all English nouns end in s in plural form right?).

SINGULAR     PLURAL
---------    --------
car          cars
boat         boats
man          men
woman        women
omen         omens
bus          buses
cactus       cacti
spy          spies
pie          pies
louse        lice
mouse        mice
amice        amices
goose        geese
creese       creeses
person       people
child        children
siren        sirens
ox           oxen
foot         feet
tooth        teeth
formula      formulae
minx         minxes
sphinx       sphinges
wife         wives
knife        knives
ion          ions
criterion    criteria
jinni        jinn
zero         zeros
hero         heroes


Yes, some of the words have alternative forms, but these are the ones we're going to use.

Here is a script that can help you with the testing; just put your regex between the two slashes (/) on the first line.

• Hmm, interesting challenge! I never knew the sphinx one; I always thought it was sphynxes :-P +1 – Doorknob Jan 16 '14 at 23:48
• glad you didn't add fish and sheep to the list :) – mniip Jan 16 '14 at 23:53
• I'm probably missing something (this is not my first language, and most of us have scarce relationships with them anyways) but shouldn't the 4th entry be "women"? – Tobia Jan 16 '14 at 23:54
• @daniero well, 28 is a nice round number too (base 7 or base 28 or ...) (relevant spikedmath comic) – Justin Jan 17 '14 at 0:02
• Typical English esoteric rules - for example, if plural for goose is geese, then how come the plural for moose is not meese? (Its actually moose - a gotcha there) – t0mm13b Jan 17 '14 at 0:48

44, or 46 if delimiting // count:

dr|wome|[aglx]e|et|ti|ia|[^u]s$|nn$|^.ic|^me


42 (or 44 with delimiters)

^.(e[^r]|ic)|x.|..me|ia|ti|.l..|nn$|[^u]s$ - Try it online!
^.(e[^r]|ic)|x.|..me|ia|[adjlu]...$|[^u]s$ - Try it online!

65 or 67

^[lm]i[^n]|^ge|ti|ia|[l|a]e$|ox.|^(wo)?men$|dren|nn$|et|[netro]s$