## Haskell, 72 bytes (no regex) g(a:b:c)|a==b=g c g x=x==[] or.map(g.words.concat).mapM(\c->[[c],c:" "]) A brute-force approach. [Try it on Ideone](http://ideone.com/VqybtA). ## Explanation The helper function `g` takes a list of strings, and checks that it consists of pairs of identical strings, like `["aa","aa","bba","bba","ab","ab"]`. The (anonymous) main function splits a string in all possible ways, and checks that at least one splitting results in a list that `g` accepts. g(a:b:c) g on list with elements a, b and tail c, |a==b in the case that a==b, =g c recurses to the tail c. g x= g on any other list x x==[] checks that x is empty. This includes the case where a is not equal to b, resulting in False. or.map(g.words.concat).mapM(\c->[[c],c:" "]) The main function: mapM(\c->[[c],c:" "]) Replace each letter c with either "c" or "c " in all possible ways, return list of results. map( ). Map this function over the results: concat Concatenate the 1- or 2-letter strings, words. split again at each space, g. apply g. or. Check that at least one result gave True.