$$L=\{x\in\Sigma^{*}:\text{ both 00 and 11 are substr of x, first occurence of 00 is before first occurrence of 11}\}$$
The expression I thought of is
$R=(1+0)00(1+0)^*11(1+0)^*$
First symbol is anything, then it's followed by $00$, then any binary string, then $11$, then again any binary string.
The only problem with this regex is that it does not accept something like:
$1010|00|11$ (the $|$ is just so you can see the division better.
Also doesn't accept $0101|00|11$
So I thought of replacing $(1+0)$ with $(01+10)^*$, but then one can easily form $0110$, which is not allowed. How do I modify my regex to match this?
You can do $((10)^*1 + (01)^*)00(1+0)^*11(1+0)^*$. The first part should take care of any $01$ or $10$ substrings at the head.