130 views
In certain programming languages, comments appear between delimiters such as $\text{/#}$ and $\text{#/}.$ Let $C$ be the language of all valid delimited comment strings. A member of $C$ must begin with $\text{/#}$ and end with $\text{#/}$ but have no intervening $\text{#/}.$  For simplicity, assume that the alphabet for $C$ is $\text{Σ = \{a, b, /, # \}.}$
a. Give a $DFA$ that recognizes $C.$
b. Give a regular expression that generates $C.$
| 130 views

Regular expression: /#(a + b + /+ #*a + #*b)*#/

by Active (5.1k points)