An alphabet is a finite nonempty set of symbols. A word over an alphabet is a finite sequence of symbols from , including the empty word ; the set of all words is . A formal language over is any subset .
A regular expression is defined recursively from , , and the individual symbols by the operations of finite union, concatenation, and Kleene star. Its language is defined by
There are only countably many regular expressions: each is a finite word over a finite collection of symbols and punctuation. On the other hand, for every nonempty finite alphabet, is countably infinite, so its power set is uncountable by the Cantor theorem. Thus there are uncountably many languages but only countably many languages denoted by regular expressions. Consequently