I am practicing for an exam. I am trying to convert a language to a regular expression. The language and my solution is as follows:
$L=\{w∈\{a,b\}^+│|w|≥4\ and\ the\ second\ symbols\ from \ the \ front\ and\ the\ back\ are\ equal\}$
Solution: $(a+b)x(a+b)^* x(a+b) \ \ where\ x=(a+b)$
Is this correct? If not, can someone correct me. also, am I allowed to use variables in regular expressions?
Thanks in advance