Let's say that I have the following words that I want to accept in a regular expression.
iare, sare, are, snore , zere, tnore
I could use the or
expression going this way : (iare|sare|are|snore|zere|tnore)
but trying to optimize it, I rewrote it as following : (s|t)?(t|n)?(i|s|a|z|t)?(a|o|e)re
Is there a way to write a better regex than the last one?
Any help would be appreciated. Thanks