Consider the language:
$L=$binary strings that contain a substring of the form $ww$, where $w \in (0+1)(0+1)^*$.
I am convinced this language is not regular, as $w$ can have arbitrary length due to the $(0+1)^*$ term, and whatever is generated by this term must be remembered for the next occurrence of $w$ immediately thereafter. So, a DFA cannot accept this language. Is this correct? Perhaps, I could show this more formally with the pumping lemma, but I just want to make sure the intuition is correct.
Now, do you agree that the way I have defined the language above implies that the first occurrence of $w$ must be the same as the second occurrence of $w$? For example, $w$ cannot equal $01$ in its first instance, but $011$ in its second instance.
Now, consider the language:
$T=$binary strings that contain a substring of the form $wy$, where $w,y \in (0+1)(0+1)^*$.
T is regular. Because $(0+1)^*(0+1)=(0+1)(0+1)^*$, the regex representing $T$ can be written as $(0+1)^*(00+01+10+11)(0+1)^*$. Is this correct?
Now, back to language $L$. This was defined in some exercises I was doing exactly as it is above. The solution said that $L$ is regular and can be represented by regular expression: $(0+1)^*(00+11+0101+1010)(0+1)^*$.
Lastly, If my thinking about $L$ is incorrect for some reason, does the regular expression $(0+1)^*(0+1)(0+1)^*(0+1)(0+1)^*(0+1)^*$ equal $L$?
I hope I have communicated my thoughts clearly on this matter. Please help me understand.