Formal languages and infinite groups