Regular Expression
Regular expressions define formal languages as sets of strings over a finite alphabet. Let sigma denote a selected alphabet. Then emptyset is a regular expression that denotes the empty set and epsilon is a regular expression that denotes the set containing the empty string as its only element.
If c in sigma, then c is a regular expression that denotes the set whose only element is string c. If p and q are regular expressions denoting sets L(p) and L(q), then
1. (p)|(q) is a regular expression denoting the set L(p) union L(q), where union denotes the union.
2. (p)(q) is a regular expression denoting the set of all concatenations of m and n, where m in L(p) and n in L(q).
3. (p)^* is a regular expression denoting closure of L(p), that is, the set of zero or more concatenations of strings from L(p)
The sets defined by regular expressions are called regular sets, and a set is regular iff it is defined by a right linear grammar.
See also
Formal Language, GrammarThis entry contributed by Alex Sakharov (author's link)
Explore with Wolfram|Alpha
More things to try:
References
Aho, A. V. and Ullman J. D. Theory of Parsing, Translation and Compiling, Vol. 1. Englewood Cliffs, NJ: Prentice Hall, 1972.Aho, A. V. and Ullman J. D. Theory of Parsing, Translation and Compiling, Vol. 2. Englewood Cliffs, NJ: Prentice Hall, 1972.Referenced on Wolfram|Alpha
Regular ExpressionCite this as:
Sakharov, Alex. "Regular Expression." From MathWorld--A Wolfram Resource, created by Eric W. Weisstein. https://mathworld.wolfram.com/RegularExpression.html