If I have a language $L$ such that $L= \{xww^r \mid \text{ $x$ and $w$ belong to }(a+b)^+) \}$.
Then can't we write regular expression for this to be $(a+b)^+(ab+ba)$?
What's wrong in this regular expression ?
Also what if I have $L= \{wxw^r \mid \text{$x$ and $w$ belong to }(a+b)^+) \}$ or $L=\{ww^rx \mid \text{$x$ and $w$ belongs to }(a+b)^+) \}$
Does the position of $x$ affect the nature of the language ?
Hint. Take $x = w = a$. Does $xww^r$ match your regular expression?