$L = \{w \in \{a, b, c\}^*\mid w\text{ contains at least one }a\text{ and at least one }b\}$.

what's the proper regular expression for the following language?

  • 1
    $\begingroup$ Start with a regular expression for strings which contain, at some point, an $a$, and at a later point, a $b$. $\endgroup$ – Yuval Filmus Apr 15 '18 at 8:36

The DFA of this language can be easily written.

Apply state removal method to this machine, then you can receive a regular expression.

Reference to state removal method: How to convert finite automata to regular expressions?


Not the answer you're looking for? Browse other questions tagged or ask your own question.