patternModerate
Is $\{w_1xw_2\mid w_1,w_2\in \{a,b\}^* \text{ and } x \in \{a,b\}\}$ regular or not?
Viewed 0 times
midtextregularw_2w_1xw_2andnotw_1
Problem
The language given is $L = \{w_1xw_2\mid w_1,w_2\in \{a,b\}^* \text{ and } x \in \{a,b\}\}$. Is this language regular or not?
Since there is no pattern, so it should be non-regular?
Kindly help!
Since there is no pattern, so it should be non-regular?
Kindly help!
Solution
The language is regular and a possible regular expression for $L$ is $(a\mid b)^ (a \mid b) (a \mid b)^ = (a \mid b)^+$.
Context
StackExchange Computer Science Q#142565, answer score: 17
Revisions (0)
No revisions yet.