I've tried the following solution but it may not cover all the strings
b(aa+ab+ba+bb)* + (aa+ab+ba+bb)*b
here + means OR operation and * means repetition.
Can someone debug the above regex?
RE = (a+b)((a+b)(a+b))*
b(a+b)((a+b)(a+b))*
+
((a+b)(a+b))*
b((a+b)(a+b))*
I hope it will cover all strings