Regular Expression Examples
Let ? = {a, b}.
a = {a}
ab = {ab}
a | b = {a, b}
a+ = {a, aa, aaa, ... }
ab* represents the set of strings having a single a followed by zero or more occurrences of b.
That is, it’s {a, ab, abb, abbb, ... }
a (b | c) = {ab, ac}
(a | b) (c | d) = {ac, ad, bc, bd}
aa* = a+ = {a, aa, aaa, ... }
Previous slide
Next slide
Back to first slide
View graphic version