Definition. Regular expressions (concrete syntax) [0176]

Let \Sigma be an alphabet. We then let \Sigma _{\mathsf {rx}} be the disjoint union of \Sigma with the set {\mathopen {}\left \{\underline {\epsilon },\varnothing , \vert ,*,(,)\right \}\mathclose {}}. Then a concrete syntax of regular expressions over \Sigma can be defined as a formal language over \Sigma _{\mathsf {rx}}, which we present by means of the following syntactic rules:

\begin {gathered} \displaystyle \frac {\displaystyle }{\displaystyle \quad a\quad } \qquad \displaystyle \frac {\displaystyle }{\displaystyle \quad \underline {\epsilon }\quad } \qquad \displaystyle \frac {\displaystyle }{\displaystyle \quad \varnothing \quad } \\ \displaystyle \frac {\displaystyle r}{\displaystyle \quad (r)\quad } \qquad \displaystyle \frac {\displaystyle r\quad s}{\displaystyle \quad r\vert s\quad } \qquad \displaystyle \frac {\displaystyle r\quad s}{\displaystyle \quad rs\quad } \qquad \displaystyle \frac {\displaystyle r}{\displaystyle \quad r*\quad } \end {gathered}

Above we let a range over \Sigma and r,s range over \Sigma _{\mathsf {rx}}^\star . We are careful to distinguish the formal symbol \underline {\epsilon } from \epsilon : \epsilon is literally the empty string, whereas \underline {\epsilon } is the symbol representing the regular expression that matches the empty string!