Shaojun Z. answered 05/20/22
Rich experiences at Google, Facebook, Amazon, and etc. Ph.D in A.I.
To show a language is regular, it is suffice to show that a regular expression can generate that language.
This regular expression does the job for the language L you specified:
(v1(a|b)*v1) | (v2(a|b)*v2) | ... (v8(a|b)*v8)
where v1 to v8 is aaa, aab, aba, abb, baa, bab, bba, bbb.
Notice that the string v before w and the string v after w have to be identical and have length of 3. The above regular expression obeys both, plus the string w can be anything as long as the vocabulary is in {a, b}.