Kleene star
unary operation on sets of strings, used in regular expressions for "zero or more repetitions"
In mathematical logic and computer science, the Kleene star (or Kleene operator or Kleene closure) is a mathematical process or operation on sets of numbers, characters (like letters) or symbols. It is often used for regular expressions.
As an example, if we take a set of numbers and call it , and create a never-ending list of all the numbers in that set, in all the combinations that are possible with those numbers, then we have created the Kleene star of . So, given a set, it's the set of all string combinations of members of that set.
Examples
changeLet's create a set called V, and put the symbols a and b in it.
V = {a, b}
So here's the Kleene star applied to that set of characters:
- {"a", "b"}+ = { "a", "b", "aa", "ab", "ba", "bb", "aaa", "aab", ...}.