I know a regular language is the one which can be expressed as a regular expression or we can create a DFA corresponding to it. Unless a language has a pattern in which one part has to match with other like in $$a^nb^n|n\geq 0 (CFG)$$ It'll be regular. Like AP Series of symbols can be easily expressed as Regular expression but GP Series can not. But I failed to understand why the following languages are regular$L_1=\{wxw^R \mid w,x \in (a,b)^+\}$$L_2=\{wxwy \mid w,x,y \in (a,b)^+\}$$L_3=\{xwyw \mid w,x,y \in (a,b)^+\}$
Understanding Regular Grammers
regular languages;regular expressions
All these languages are regular. This comes from the fact $w$ could simply be a single letter, and thus the languages admit the following regular expressions (assuming here $\Sigma=\{a,b\}$, but this would work for any finite alphabet):$$L_1=a(a+b)^+a+b(a+b)^+b$$$$L_2=a(a+b)^+a(a+b)^++b(a+b)^+b(a+b)^+$$$$L_2=(a+b)^+a(a+b)^+a+(a+b)^+b(a+b)^+b$$A more detailed explanation:In the definition we had: $w\in\{a,b\}^+$. This mean that $w$ could be a single letter, $a$, or $b$, and thus we can attribute the rest of the word to $x$ (or $y$).For example, if:$$u=abbababa\in L_1$$, because it can be decomposed as $w=a, x=bbabab$ and $$u=wxw^R$$. Similarly, each word which starts and ends with a $a$ is in $L_1$ (pick $w=a$), and each word that starts and ends with a $b$ is also in $L_1$ (pick $w=b$). This is why $$L_1=\{axa|x\in\{a,b\}^+\}\cup\{bxb|x\in\{a,b\}^+\}$$, and thus regular. Same tricks apply to the other languages and all three are indeed regular (by the regex I gave).