Example. Examples of regular expression matching [017E]
Consider regular expression matching over the alphabet \Sigma ={\mathopen {}\left \{a,b\right \}\mathclose {}}.
- a\vert b is matched by each symbol in \Sigma .
- (a\vert b)* is matched every string over \Sigma .
- b(a\vert b)* is matched by any string over \Sigma that starts with a b.
- ((a\vert b)(a\vert b))* is matched by any string of even length over \Sigma .
- (\underline {\epsilon }\vert a)(\underline {\epsilon }\vert b)\vert bb is matched just by the strings \epsilon , a, b, ab, and bb.
- \varnothing b\vert a is matched only by the symbol a.