% simple_grep '^(\w+)(\w+)?(?(2)\2\1|\1)$' /usr/dict/words output : beriberi coco couscous deed ... toot toto tutu [download]
In reply to Conditional regex by chimni