2
$\begingroup$

For the language $\{w \mid w \in \Sigma^*, w \neq \lambda\}$, is the following regular expression correct?

$(a+b)^+$ . Which is $(a+b)$ to the power of $+$ which I think accepts all combinations of $a$ and $b$ except for the empty string.

Can someone please confirm?

  • 3
    You are correct.2012-10-18

2 Answers 2

1

yes it is correct (assuming that Σ={a,b} )

0

Some people don't allow $r^+$ in their definition of regular expressions, in which case you'd have to settle for using $(\mathtt{a}+\mathtt{b})(\mathtt{a}+\mathtt{b})^*$, but otherwise, I'd agree with May: you got it.